Skip to content

RequestResponseHandler/RequestResponseWithIDHandler are awkward w.r.t. sendability #267

@glbrntt

Description

@glbrntt

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:

  1. Require Response to be Sendable and allow the promises to be for different event-loops
  2. No Sendable requirement and fail a promise if it's for the wrong event loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions