-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for setOnCloseHandler being Experimental #8467
Comments
API review notes:
So that voting isn't our normal voting just at the end. We put votes in as we discussed and it was more +1/-1 in a ACK/NACK sense. We did a typical vote (one vote per person) for onClose/onClosed since that was the clear set of favorites, beating out all the other options except tying with onCallCompleteHandler for one person. It was actually a bit strange how long it took for onCloseHandler to be put on the table. But discussion quickly centered around it after it was proposed. @morgwai, let's change the PR to |
I'm on it :) just 1 cent regarding |
Yeah, that was one of the arguments ("onClosed is a mismatch with “onCancelHandler” (it isn’t onCancelledHandler)"). However, onCancel and onCancelled have the same meaning since cancellation is essentially instantaneous. The problem with close is it takes a while and so the two names could be viewed to have different meanings ("onClosed makes it more clear that the operation is complete, instead of just initiated"). |
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: eitheronCompleted()
oronError(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 fromListener
's method but causes confusion withStreamObserver.onCompleted()
onSuccessHandler
: my initial idea, yet also confusing as it can be called also afterStreamObserver.onError(...)
onFinishHandler
: current approach, matches well the verb from method's javadoconFinalizeHandler
: would also probably do wellThe text was updated successfully, but these errors were encountered: