You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Service server: Extend API to be able to defer a response #1707
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.
changed the title [-]Service server: Extend API to be able to respond to requests asynchronously[/-][+]Service server: Extend API to be able to defer a response[/+]on Jul 1, 2021
Activity
[-]Service server: Extend API to be able to respond to requests asynchronously[/-][+]Service server: Extend API to be able to defer a response[/+]wjwwood commentedon Jul 1, 2021
Is this the same as #491?
ivanpauno commentedon Jul 2, 2021
Yes, it's the same.
My idea was to extend
Serviceconstructor so that it also accepts a callback with signatureinstead of adding an
AsyncServiceclass.@wjwwood what do you think?
wjwwood commentedon Jul 12, 2021
Let's close one or the other then.
wjwwood commentedon Jul 12, 2021
Yes, I think this is preferable.
ivanpauno commentedon Jul 12, 2021
Closing in favor of #491.