Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A BUG on internal/store/inmem.go #7

Open
wanggeng01041454 opened this issue Sep 26, 2024 · 0 comments
Open

A BUG on internal/store/inmem.go #7

wanggeng01041454 opened this issue Sep 26, 2024 · 0 comments

Comments

@wanggeng01041454
Copy link

In Push Function, I think you forget :

m.events = events

And more, if we can determain that " if the 'getter' do not consume the message, the 'pusher' can not push new message", we can drop all of this code in Push function

// dorp it
	events := make([]*bridge.Event, 0, len(m.events)+1)
	for _, e := range m.events {
		if e.Deadline-tm > 0 { // cleanup outdated
			events = append(events, e)
		}
	}

And more and more, You always alloc new array in Push, and drop it in ExecuteAll. Can you implement a ring buffer to improve the profermance ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant