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

Example showing request + response #101

Open
brandonros opened this issue Mar 14, 2022 · 5 comments
Open

Example showing request + response #101

brandonros opened this issue Mar 14, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@brandonros
Copy link

I know it's pretty custom and not a typical usecase but I think it'd be pretty cool to show the power of the library to show how to do exact request + response. aka, tx, wait for rx back, but don't risk getting the rx from a different tx out of order.

@zesterer
Copy link
Owner

I agree, an example of this would be useful! I'll see whether I get time to add one in the next few weeks.

@zesterer zesterer added enhancement New feature or request help wanted Extra attention is needed labels Mar 14, 2022
@brandonros
Copy link
Author

Is this possible without some kind of request/reply correlation IDs? my fear is that you would transmit a message, then switch to being a receiver, but receive a response to a message that you didn’t just transmit. For example like out of order

@zesterer
Copy link
Owner

Flume guarantees ordering from the perspective of a particular thread. In general, you'd probably want to have two channels for this to work: one to send on, one to receive on. You also wouldn't want to share them between many threads because the messages might be received by the wrong thread.

@brandonros
Copy link
Author

can you think of a way to solve multi-threaded exact request/response with channels or not really?

@Restioson
Copy link
Collaborator

Restioson commented Mar 15, 2022

Is this possible without some kind of request/reply correlation IDs? my fear is that you would transmit a message, then switch to being a receiver, but receive a response to a message that you didn’t just transmit. For example like out of order

The way this works in xtra is by using Flume one channel from sender to receiver, and sending a oneshot channel half along with the request that needs a response. There are alternate designs of course - maybe using IDs like you said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants