grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

Tracking Issue for setOnCloseHandler being Experimental

Open morgwai opened this issue 3 years ago • 3 comments

To resolve issue #5895 PR #8452 has been created that adds new ServerCallStreamObserver.setOnFinishHandler(...) method. The handler is called by Listener.onComplete when the call is finished correctly from the server's point of view: either onCompleted() or onError(Throwable) has been called, all the messages and trailing metadata have been put on the wire and the stream has been closed.

Several names were proposed for the handler:

  • onCompleteHandler : derives name from Listener's method but causes confusion with StreamObserver.onCompleted()
  • onSuccessHandler : my initial idea, yet also confusing as it can be called also after StreamObserver.onError(...)
  • onFinishHandler : current approach, matches well the verb from method's javadoc
  • onFinalizeHandler : would also probably do well

morgwai avatar Sep 01 '21 15:09 morgwai