INTERNAL API
INTERNAL API
This allows the dynamic creation of an Inlet for a GraphStage which is
connected to a Sink that is available for materialization (e.g. using
the subFusingMaterializer
). Care needs to be taken to cancel this Inlet
when the stage shuts down lest the corresponding Sink be left hanging.
INTERNAL API
INTERNAL API
This allows the dynamic creation of an Outlet for a GraphStage which is
connected to a Source that is available for materialization (e.g. using
the subFusingMaterializer
). Care needs to be taken to complete this
Outlet when the stage shuts down lest the corresponding Sink be left
hanging. It is good practice to use the timeout
method to cancel this
Outlet in case the corresponding Source is not materialized within a
given time limit, see e.g. ActorMaterializerSettings.
Abort outstanding (suspended) emissions for the given outlet, if there are any.
Abort outstanding (suspended) emissions for the given outlet, if there are any.
This will reinstall the replaced handler that was in effect before the emit
call.
Abort outstanding (suspended) reading for the given inlet, if there is any.
Abort outstanding (suspended) reading for the given inlet, if there is any.
This will reinstall the replaced handler that was in effect before the read
call.
INTERNAL API
INTERNAL API
INTERNAL API
INTERNAL API
Requests to stop receiving events from a given input port.
Requests to stop receiving events from a given input port. Cancelling clears any ungrabbed elements from the port.
Signals that there will be no more elements emitted on the given port.
Signals that there will be no more elements emitted on the given port.
Automatically invokes cancel() or complete() on all the input or output ports that have been called, then marks the stage as stopped.
Automatically invokes cancel() or complete() on all the input or output ports that have been called, then marks the stage as stopped.
Input handler that terminates the state upon receiving completion if the given condition holds at that time.
Input handler that terminates the state upon receiving completion if the given condition holds at that time. The stage fails upon receiving a failure.
Output handler that terminates the state upon receiving completion if the given condition holds at that time.
Output handler that terminates the state upon receiving completion if the given condition holds at that time. The stage fails upon receiving a failure.
Java API: Obtain a callback object that can be used asynchronously to re-enter the current GraphStage with an asynchronous notification.
Java API: Obtain a callback object that can be used asynchronously to re-enter the current GraphStage with an asynchronous notification. The invoke() method of the returned AsyncCallback is safe to be called from other threads and it will in the background thread-safely delegate to the passed callback function. I.e. invoke() will be called by the external world and the passed handler will be invoked eventually in a thread-safe way by the execution environment.
This object can be cached and reused within the same GraphStageLogic.
Input handler that terminates the stage upon receiving completion.
Input handler that terminates the stage upon receiving completion. The stage fails upon receiving a failure.
Output handler that terminates the stage upon cancellation.
Output handler that terminates the stage upon cancellation.
Emit an element through the given outlet, suspending execution if necessary.
Emit an element through the given outlet, suspending execution if necessary.
This action replaces the OutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal.
Emit an element through the given outlet and continue with the given thunk afterwards, suspending execution if necessary.
Emit an element through the given outlet and continue with the given thunk
afterwards, suspending execution if necessary.
This action replaces the OutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal (before invoking the andThen
function).
Emit a sequence of elements through the given outlet, suspending execution if necessary.
Emit a sequence of elements through the given outlet, suspending execution if necessary.
This action replaces the OutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal.
Emit a sequence of elements through the given outlet and continue with the given thunk afterwards, suspending execution if necessary.
Emit a sequence of elements through the given outlet and continue with the given thunk
afterwards, suspending execution if necessary.
This action replaces the OutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal (before invoking the andThen
function).
Java API
Java API
Emit a sequence of elements through the given outlet, suspending execution if necessary.
This action replaces the AbstractOutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal.
Java API
Java API
Emit a sequence of elements through the given outlet, suspending execution if necessary.
This action replaces the AbstractOutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal.
Emit a sequence of elements through the given outlet, suspending execution if necessary.
Emit a sequence of elements through the given outlet, suspending execution if necessary.
This action replaces the OutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal.
Emit a sequence of elements through the given outlet and continue with the given thunk afterwards, suspending execution if necessary.
Emit a sequence of elements through the given outlet and continue with the given thunk
afterwards, suspending execution if necessary.
This action replaces the OutHandler for the given outlet if suspension
is needed and reinstalls the current handler upon receiving an onPull()
signal (before invoking the andThen
function).
Signals failure through the given port.
Signals failure through the given port.
Automatically invokes cancel() or fail() on all the input or output ports that have been called, then marks the stage as stopped.
Automatically invokes cancel() or fail() on all the input or output ports that have been called, then marks the stage as stopped.
Obtain a callback object that can be used asynchronously to re-enter the current GraphStage with an asynchronous notification.
Obtain a callback object that can be used asynchronously to re-enter the current GraphStage with an asynchronous notification. The invoke() method of the returned AsyncCallback is safe to be called from other threads and it will in the background thread-safely delegate to the passed callback function. I.e. invoke() will be called by the external world and the passed handler will be invoked eventually in a thread-safe way by the execution environment.
This object can be cached and reused within the same GraphStageLogic.
Retrieves the current callback for the events on the given Outlet
Retrieves the current callback for the events on the given Outlet
Retrieves the current callback for the events on the given Inlet
Retrieves the current callback for the events on the given Inlet
Initialize a StageActorRef which can be used to interact with from the outside world "as-if" an Actor.
Initialize a StageActorRef which can be used to interact with from the outside world "as-if" an Actor. The messages are looped through the getAsyncCallback mechanism of GraphStage so they are safe to modify internal state of this stage.
This method must (the earliest) be called after the GraphStageLogic constructor has finished running, for example from the preStart callback the graph stage logic provides.
Created StageActorRef to get messages and watch other actors in synchronous way.
The StageActorRef's lifecycle is bound to the Stage, in other words when the Stage is finished, the Actor will be terminated as well. The entity backing the StageActorRef is not a real Actor, but the GraphStageLogic itself, therefore it does not react to PoisonPill.
callback that will be called upon receiving of a message by this special Actor
minimal actor with watch method
Once the callback InHandler.onPush() for an input port has been invoked, the element that has been pushed can be retrieved via this method.
Once the callback InHandler.onPush() for an input port has been invoked, the element that has been pushed can be retrieved via this method. After grab() has been called the port is considered to be empty, and further calls to grab() will fail until the port is pulled again and a new element is pushed as a response.
The method isAvailable() can be used to query if the port has an element that can be grabbed or not.
Indicates whether there is already a pending pull for the given input port.
Indicates whether there is already a pending pull for the given input port. If this method returns true then isAvailable() must return false for that same port.
Input handler that does not terminate the stage upon receiving completion.
Input handler that does not terminate the stage upon receiving completion. The stage fails upon receiving a failure.
Output handler that does not terminate the stage upon cancellation.
Output handler that does not terminate the stage upon cancellation.
Return true if the given output port is ready to be pushed.
Return true if the given output port is ready to be pushed.
Indicates whether there is an element waiting at the given input port.
Indicates whether there is an element waiting at the given input port. grab() can be used to retrieve the element. After calling grab() this method will return false.
If this method returns true then hasBeenPulled() will return false for that same port.
Indicates whether the port has been closed.
Indicates whether the port has been closed. A closed port cannot be pushed.
Indicates whether the port has been closed.
Indicates whether the port has been closed. A closed port cannot be pulled.
Override to customise reported log source
Override to customise reported log source
The akka.stream.Materializer that has set this GraphStage in motion.
The akka.stream.Materializer that has set this GraphStage in motion.
Install a handler on the given inlet that emits received elements on the given outlet before pulling for more data.
Install a handler on the given inlet that emits received elements on the
given outlet before pulling for more data. doFinish
and doFail
control whether
completion or failure of the given inlet shall lead to stage termination or not.
doPull
instructs to perform one initial pull on the from
port.
Invoked after processing of external events stopped because the stage is about to stop or fail.
Invoked after processing of external events stopped because the stage is about to stop or fail.
Invoked before any external events are processed, at the startup of the stage.
Invoked before any external events are processed, at the startup of the stage.
Requests an element on the given port.
Requests an element on the given port. Calling this method twice before an element arrived will fail. There can only be one outstanding request at any given time. The method hasBeenPulled() can be used query whether pull is allowed to be called or not. This method will also fail if the port is already closed.
Emits an element through the given output port.
Emits an element through the given output port. Calling this method twice before a pull() has been arrived will fail. There can be only one outstanding push request at any given time. The method isAvailable() can be used to check if the port is ready to be pushed or not.
Java API: Read an element from the given inlet and continue with the given function, suspending execution if necessary.
Java API: Read an element from the given inlet and continue with the given function,
suspending execution if necessary. This action replaces the InHandler
for the given inlet if suspension is needed and reinstalls the current
handler upon receiving the onPush()
signal (before invoking the andThen
function).
Read an element from the given inlet and continue with the given function, suspending execution if necessary.
Read an element from the given inlet and continue with the given function,
suspending execution if necessary. This action replaces the InHandler
for the given inlet if suspension is needed and reinstalls the current
handler upon receiving the onPush()
signal (before invoking the andThen
function).
Java API: Read a number of elements from the given inlet and continue with the given function, suspending execution if necessary.
Java API: Read a number of elements from the given inlet and continue with the given function,
suspending execution if necessary. This action replaces the InHandler
for the given inlet if suspension is needed and reinstalls the current
handler upon receiving the last onPush()
signal (before invoking the andThen
function).
Read a number of elements from the given inlet and continue with the given function, suspending execution if necessary.
Read a number of elements from the given inlet and continue with the given function,
suspending execution if necessary. This action replaces the InHandler
for the given inlet if suspension is needed and reinstalls the current
handler upon receiving the last onPush()
signal.
If upstream closes before N elements have been read,
the onClose
function is invoked with the elements which were read.
Assigns callbacks for the events for an Outlet
Assigns callbacks for the events for an Outlet
Assigns callbacks for the events for an Inlet
Assigns callbacks for the events for an Inlet
Assign callbacks for linear stage for both Inlet and Outlet
Controls whether this stage shall shut down when all its ports are closed, which is the default.
Controls whether this stage shall shut down when all its ports are closed, which
is the default. In order to have it keep going past that point this method needs
to be called with a true
argument before all ports are closed, and afterwards
it will not be closed until this method is called with a false
argument or the
stage is terminated via completeStage()
or failStage()
.
An akka.stream.Materializer that may run fusable parts of the graphs that it materializes within the same actor as the current GraphStage (if fusing is available).
An akka.stream.Materializer that may run fusable parts of the graphs that it materializes within the same actor as the current GraphStage (if fusing is available). This materializer must not be shared outside of the GraphStage.
Input handler that does not terminate the stage upon receiving completion nor failure.
Input handler that does not terminate the stage upon receiving completion nor failure.
Requests an element on the given port unless the port is already closed.
Requests an element on the given port unless the port is already closed. Calling this method twice before an element arrived will fail. There can only be one outstanding request at any given time. The method hasBeenPulled() can be used query whether pull is allowed to be called or not.
Java API: GraphStageLogic with StageLogging.