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

refactor(memory): use mpsc not broadcast #22

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

svix-onelson
Copy link
Contributor

Initially motivated by the fact broadcast has consumer semantics that don't align with the higher level API we'd like to expose, but I hear there's also a perf concern.

@svix-onelson svix-onelson force-pushed the onelson/mpsc-not-broadcast branch from a9d2b9a to a6934a0 Compare February 2, 2024 17:42
@svix-onelson svix-onelson marked this pull request as ready for review February 2, 2024 17:43
Unsure if this is going to be needed.
Can avoid redoing/adding mem backend by simply giving usize::MAX for
capacity, or whatever is allowable for broadcast. The underlying channel
is a private detail.
@svix-onelson svix-onelson force-pushed the onelson/mpsc-not-broadcast branch from a6934a0 to e0ed48c Compare February 2, 2024 17:48
.rx
.recv()
.await
.ok_or_else(|| QueueError::Generic("recv failed".into()))?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used QueueError::Generic(mpsc::TryRecvError::Disconnected) here instead in my local branch, not sure if it's better or worse than what you wrote though ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to fix that up as you see fit in your continuing dev ;)

@svix-onelson svix-onelson merged commit bcf6a1b into main Feb 2, 2024
2 checks passed
@svix-onelson svix-onelson deleted the onelson/mpsc-not-broadcast branch February 2, 2024 20:40
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

Successfully merging this pull request may close these issues.

2 participants