salesforce / reactive-grpc

Reactive stubs for gRPC
BSD 3-Clause "New" or "Revised" License
829 stars 118 forks source link

Add onDiscard hook support to AbstractStreamObserverAndPublisher #292

Closed bruto1 closed 1 year ago

bruto1 commented 2 years ago

Currently, upon cancellation it just clears the queue, but its elements, for example, can be backed by reference counted objects which need to be released before being garbage collected (it's possible thanks to https://github.com/GoogleCloudPlatform/grpc-gcp-java/pull/77 ) An example of when and how discarding is done can be found in FluxFlatMap, for example, or any other operator impl with a queue