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

Bounded synchronous channel for consumer. #196

Open
fpagliughi opened this issue Mar 9, 2023 · 0 comments
Open

Bounded synchronous channel for consumer. #196

fpagliughi opened this issue Mar 9, 2023 · 0 comments
Assignees
Milestone

Comments

@fpagliughi
Copy link
Contributor

PR #191 added the choice of a bounded or unbounded channel in an async/await client. We should do the same thing for the sync channel created in AsyncClient::start_consuming().

But as this would be a breaking change for the function signature, it needs to wait for the next major update.

I assume it would be implemented in the same way as the async stream, something like:

pub fn start_consuming<L>(&mut self, buffer_lim: L) -> Receiver<Option<Message>>
where
    L: Into<Option<usize>>,
{
    let (tx, rx) = match buffer_lim.into() {
        None => channel::unbounded(),
        Some(lim) => channel::bounded(lim),
    };
    ...
@fpagliughi fpagliughi added this to the v0.13 milestone Mar 9, 2023
@fpagliughi fpagliughi self-assigned this Mar 9, 2023
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