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

Investigate other designs #3

Open
aesteve opened this issue Jun 19, 2020 · 1 comment
Open

Investigate other designs #3

aesteve opened this issue Jun 19, 2020 · 1 comment

Comments

@aesteve
Copy link
Owner

aesteve commented Jun 19, 2020

At the moment, the user can subscribe to incoming messages by passing a MessageHandler, a default implementation for static Functions is provided, and the user can implement the trait if (s)he needs to.

It could be a good idea to grasp inspirations from other crates to know how such a pattern is handled. Giving the user an infinite iterator over messages looks (naively) like a possibility, but how do such "infinite, blocking iterators" work?

References:

  1. Streaming iterator
    May be an interesting approach:
while let Some(message) = eb.consumer("some-address") {
    // this is an infinite loop, though :(
}
  1. "Go full async"
    https://github.com/rust-lang/rfcs/blob/master/text/2033-experimental-coroutines.md
@aesteve
Copy link
Owner Author

aesteve commented Jun 23, 2020

Using mpsc and iterators for now.

Async could be really interesting too, especially since Vert.x being async by nature, crate users would not be confused by an async implementation.

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