AbstractStageTIn, TOutOnUpstreamFailure Method |
OnUpstreamFailure(Exception, IContext) is called when upstream has signaled that the stream is completed with failure. It is not called if OnPull(IContext) or OnPush(TIn, IContext) of the stage itself throws an exception.
Note that elements that were emitted by upstream before the failure happened might not have been received by this stage when OnUpstreamFailure(Exception, IContext) is called, i.e. failures are not backpressured and might be propagated as soon as possible.
Here you cannot call Push(Object), because there might not be any demand from downstream. To emit additional elements before terminating you can use AbsorbTermination and push final elements from OnPull(IContext). The stage will then be in finishing state, which can be checked with IsFinishing.
Namespace: Akka.Streams.Stage
public abstract ITerminationDirective OnUpstreamFailure( Exception cause, IContext context )