SecretX
11/15/2021, 2:38 PMJob#invokeOnCompletion
always invoked independent on the result of that Job (e.g. it gracefully completed, or it was cancelled while suspended)?Joffrey
11/15/2021, 2:41 PMcause
of the completion (null for regular completion, an exception if failed, the cancellation exception if cancelled):
Registers handler that is synchronously invoked once on completion of this job. When the job is already complete, then the handler is immediately invoked with the job's exception or cancellation cause or. Otherwise, the handler will be invoked once when this job is complete.null
The meaning ofthat is passed to the handler:cause
* Cause iswhen the job has completed normally.null
* Cause is an instance of CancellationException when the job was cancelled normally. It should not be treated as an error. In particular, it should not be reported to error logs.
* Otherwise, the job had failed.