Skip to content

Access to closeFuture from GRPCAsyncServerCallContext #1954

Open
@wSedlacek

Description

@wSedlacek

Is your feature request related to a problem? Please describe it.

When attempting to write a server side stream there is no layer to obtain the closeFuture to add unsubscribe logic.

Describe the solution you'd like

I would love to simply have access to the closeFuture on the context, or a similar API to provide access to knowing when the client aborts the stream.

The AsyncServerCallContextProvider currently does not require anything with the closeFuture, even though the AsyncServerHandler which conforms to this protocol has the closeFuture passed into it's constructor.

Describe alternatives you've considered

I have looked into hacky work arounds to try to add my own extensions to force the closeFuture to be accessible, but it is buried behind too many layers of internal and private structs and classes.

I have looked into using the async only for unary calls and serve side streaming using the standard nio, but a provider cannot partially implement a service (so the proto would need to be split between two services)

Additional context

I am attempting to add an unsubscribe for a listener that triggers messages to be sent across the response stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementImprovements to existing feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions