-
Notifications
You must be signed in to change notification settings - Fork 467
Description
Feature request
Feature description
Currently, when creating a service one must provide a callback that takes a request and returns a response.
In some cases, the response cannot be calculated immediately.
It would be useful to also be able to create a service server only providing a callback that takes a request (the request message and the request id), but defers to send a response.
In that case, user code is responsible of sending a response later.
Implementation considerations
I'm currently using a hack in the domain bridge to work around the issue.
The use case is bridging a service between two domains.
In a service callback we want to send the request to another server in a different domain.
A response cannot immediately be sent, because we cannot block in the service callback waiting for the other service to respond.
If we could defer to send a response, we would only need to capture the "request id" in an "async_send_request" callback to the original server, and use in that callback that "request id" and response to complete the bridge.
See here.