mateodelnorte / servicebus

Simple service bus for sending events between processes using amqp.
MIT License
420 stars 66 forks source link

Feature Request: Request/Response model #98

Closed AnsonT closed 7 years ago

AnsonT commented 7 years ago

Add a request/response communication style where a response exchange and temporary queue allows the responder to reply back to the requester directly.

mateodelnorte commented 7 years ago

all you have to do, to make this work is have a bus.listen('request', fn) in one process and bus.listen('response', fn) in another.

mateodelnorte commented 7 years ago

and of course you can make the name more dynamic, pertaining to however you want to use it.

AnsonT commented 7 years ago

There's optimization to multiplex the reply queue per process, instead of per call.

mateodelnorte commented 7 years ago

This sounds to me like the kind of thing that would wrap servicebus, adding extra commands to it which leverage those that exist, keeping sb more concise.

That said, regarding the suggestion to use a single reply queue - note that makes certain assumptions about ordering which may or may not match a particular use case. Perhaps, assuming there was a prefetch of 1 set, someone doesn't want to wait for the reply to a user.update command to process before processing the reply to another command.

On Jun 2, 2017 6:27 PM, "AnsonT" notifications@github.com wrote:

There's optimization to multiplex the reply queue per process, instead of per call.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/mateodelnorte/servicebus/issues/98#issuecomment-305918122, or mute the thread https://github.com/notifications/unsubscribe-auth/AAh3X-E5QekzXT3Fy6-rzalMeAGpjlS4ks5sAIRygaJpZM4NunVY .