akka.io
Interface PipelineContext

All Known Subinterfaces:
HasActorContext, HasLogging, TcpPipelineHandler.WithinActorContext
All Known Implementing Classes:
AbstractPipelineContext

public interface PipelineContext

This base trait of each pipeline’s context provides optimized facilities for generating single commands or events (i.e. the fast common case of 1:1 message transformations).

IMPORTANT NOTICE:

A PipelineContext MUST NOT be shared between multiple pipelines, it contains mutable state without synchronization. You have been warned!

See Also:
see AbstractPipelineContext for a default implementation (Java)

Method Summary
 scala.collection.mutable.WrappedArray<scala.runtime.Nothing$> cmd()
          INTERNAL API: do not touch!
 java.lang.Object[] cmdHolder()
          INTERNAL API: do not touch!
<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>>
dealias(scala.collection.Iterable<scala.util.Either<Evt,Cmd>> msg)
          INTERNAL API: Dealias a possibly optimized return value such that it can be safely used; this is never needed when only using public API.
 scala.collection.mutable.WrappedArray<scala.runtime.Nothing$> evt()
          INTERNAL API: do not touch!
 java.lang.Object[] evtHolder()
          INTERNAL API: do not touch!
<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>>
nothing()
          A shared (and shareable) instance of an empty Iterable[Either[EvtAbove, CmdBelow}.
<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>>
singleCommand(Cmd cmd)
          Scala API: Wrap a single command for efficient return to the pipeline’s machinery.
<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>>
singleEvent(Evt evt)
          Scala API: Wrap a single event for efficient return to the pipeline’s machinery.
 

Method Detail

cmdHolder

java.lang.Object[] cmdHolder()
INTERNAL API: do not touch!


evtHolder

java.lang.Object[] evtHolder()
INTERNAL API: do not touch!


cmd

scala.collection.mutable.WrappedArray<scala.runtime.Nothing$> cmd()
INTERNAL API: do not touch!


evt

scala.collection.mutable.WrappedArray<scala.runtime.Nothing$> evt()
INTERNAL API: do not touch!


singleCommand

<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>> singleCommand(Cmd cmd)
Scala API: Wrap a single command for efficient return to the pipeline’s machinery. This method avoids allocating a Right and an Iterable by reusing one such instance within the PipelineContext, hence it can be used ONLY ONCE by each pipeline stage. Prototypic and safe usage looks like this:


 override val commandPipeline = { cmd =>
   val myResult = ...
   ctx.singleCommand(myResult)
 }
 

See Also:
see AbstractPipePair for the Java API

singleEvent

<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>> singleEvent(Evt evt)
Scala API: Wrap a single event for efficient return to the pipeline’s machinery. This method avoids allocating a Left and an Iterable by reusing one such instance within the context, hence it can be used ONLY ONCE by each pipeline stage. Prototypic and safe usage looks like this:


 override val eventPipeline = { cmd =>
   val myResult = ...
   ctx.singleEvent(myResult)
 }
 

See Also:
see AbstractPipePair for the Java API

nothing

<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>> nothing()
A shared (and shareable) instance of an empty Iterable[Either[EvtAbove, CmdBelow}. Use this when processing does not yield any commands or events as result.


dealias

<Cmd,Evt> scala.collection.Iterable<scala.util.Either<Evt,Cmd>> dealias(scala.collection.Iterable<scala.util.Either<Evt,Cmd>> msg)
INTERNAL API: Dealias a possibly optimized return value such that it can be safely used; this is never needed when only using public API.