public class ChannelSend<T> extends ChannelStep<T,T>
A send step returns the input value it sends so that it ca be processed further in subsequent steps if needed.
|Constructor and Description|
Creates a new instance that sends to a channel the ID of which is provided in a state relation.
|Modifier and Type||Method and Description|
This method must be implemented by subclasses to provide the actual functionality of this step.
Runs this execution step asynchronously as a continuation of a previous code execution in a
Suspends until a value can be sent to a certain channel.
Suspends until a value can be sent to the channel with the ID provided by the given function.
fail, runBlocking, terminateCoroutine, toString
deleteRelation, get, getRelation, getRelations, notifyRelationListeners, readRelations, relationsEqual, relationsHashCode, relationsString, set, set, transform, writeRelations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deleteRelation, deleteRelation, deleteRelations, get, get, get, getAll, getRelation, getRelationCount, getRelations, getRelations, hasFlag, hasRelation, hasRelations, init, set, set, set, set, set, streamRelations, transform
public static <T> ChannelSend<T> send(ChannelId<T> rId)
rId- The ID of the channel to send to
public static <T> ChannelSend<T> send(java.util.function.Function<Continuation<?>,ChannelId<T>> fGetChannelId)
fGetChannelId- The function that will return the channel ID
public void runAsync(java.util.concurrent.CompletableFuture<T> fPreviousExecution, CoroutineStep<T,?> rNextStep, Continuation<?> rContinuation)
CompletableFutureand proceeds to the next step afterwards.
Subclasses that need to suspend the invocation of the next step until
some condition is met (e.g. sending or receiving data has finished) need
to override this method and create a
Suspension by invoking
Continuation.suspend(CoroutineStep, CoroutineStep) on the next
step. If the condition that caused the suspension resolves the coroutine
execution can be resumed by calling
Subclasses that override this method also need to handle errors by
terminating any further execution (i.e. not resuming a suspension if such
exists) and forwarding the causing exception to
protected T execute(T rInput, Continuation<?> rContinuation)