Blocks until the listener has returned from its last call - AgentStreamListener.onComplete or AgentStreamListener.onError - then returns the same outcome. A call whose thread is interrupted first returns a failed result (CancelledError), with the interrupt flag still set, and the turn carries on: only cancel stops it. A call from the listener itself, which would wait on itself, returns a failed result at once.
Blocks until the listener has returned from its last call - AgentStreamListener.onComplete or AgentStreamListener.onError - then returns the same outcome. A call whose thread is interrupted first returns a failed result (CancelledError), with the interrupt flag still set, and the turn carries on: only cancel stops it. A call from the listener itself, which would wait on itself, returns a failed result at once.
Cancels the turn and returns once it has ended; the thread is left for JAgent.streamRecover. The listener receives at most the event already being delivered, then AgentStreamListener.onError with the cancellation - or onComplete, for a turn that had already ended. Safe to call more than once, from any thread, the listener's included. An interrupt does not cut the wait short: it is kept, and the thread's flag is set again on return.
Cancels the turn and returns once it has ended; the thread is left for JAgent.streamRecover. The listener receives at most the event already being delivered, then AgentStreamListener.onError with the cancellation - or onComplete, for a turn that had already ended. Safe to call more than once, from any thread, the listener's included. An interrupt does not cut the wait short: it is kept, and the thread's flag is set again on return.