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

Request/Reply pattern #66

Open
ccy opened this issue May 19, 2021 · 2 comments
Open

Request/Reply pattern #66

ccy opened this issue May 19, 2021 · 2 comments

Comments

@ccy
Copy link

ccy commented May 19, 2021

The Delphi-Event-Bus library works great for pub/sub pattern. Is that possible to use the library for request/reply pattern?

@spinettaro
Copy link
Owner

hi @ccy , might you provide an example to better understand the request?

@wloochacz
Copy link

Clear @ccy, it's simple using DEB - for example, this way:

  1. you send an IRequest message from a TClient object, which also subscribes to the IReply message.
  2. the TService object subscribes to the IRequest message. When it gets it it starts a worker thread and processes something there.... When it finishes, it sends an IResponse message
  3. the TClient object receives an IResponse message when TService finishes processing its request.

Of course, you have to implement the IRequest, IResponse and TClient, TService types yourself, as you need them.

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

3 participants