INTERNAL API: Dealias a possibly optimized return value such that it can be safely used; this is never needed when only using public API.
INTERNAL API: Dealias a possibly optimized return value such that it can be safely used; this is never needed when only using public API.
A shared (and shareable) instance of an empty Iterable[Either[EvtAbove, CmdBelow]]
.
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.
Scala API: Wrap a single command for efficient return to the pipeline’s machinery.
Scala API: Wrap a single command for efficient return to the pipeline’s machinery.
This method avoids allocating a scala.util.Right
and an scala.collection.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) }
AbstractPipePair#singleCommand see AbstractPipePair for the Java API
Scala API: Wrap a single event for efficient return to the pipeline’s machinery.
Scala API: Wrap a single event for efficient return to the pipeline’s machinery.
This method avoids allocating a scala.util.Left
and an scala.collection.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) }
AbstractPipePair#singleEvent see AbstractPipePair for the Java API
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!