RequestResponseHandler and RequestResponseWithIDHandler are generic over a request and response type. The outbound-in for each includes a promise to succeed which in some cases may be for a different event loop than the channel the handler resides in.
If the event-loop is different then the response must be Sendable to be safely transferred across isolation domains (from the channel's event loop to the promise's event loop). If the event-loop isn't different then the response doesn't need to be Sendable.
Adding the Sendable requirement to Response isn't great: it limits how the handler can be used.
One option would be to have two variants of each handler:
- Require
Response to be Sendable and allow the promises to be for different event-loops
- No
Sendable requirement and fail a promise if it's for the wrong event loop.
RequestResponseHandlerandRequestResponseWithIDHandlerare generic over a request and response type. The outbound-in for each includes a promise to succeed which in some cases may be for a different event loop than the channel the handler resides in.If the event-loop is different then the response must be
Sendableto be safely transferred across isolation domains (from the channel's event loop to the promise's event loop). If the event-loop isn't different then the response doesn't need to beSendable.Adding the
Sendablerequirement toResponseisn't great: it limits how the handler can be used.One option would be to have two variants of each handler:
Responseto beSendableand allow the promises to be for different event-loopsSendablerequirement and fail a promise if it's for the wrong event loop.