Interface JobStreamer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
JobStreamer
allows the engine to push data back to a single gateway (any). It keeps
track of multiple JobStreamer.JobStream
instances, each with their own jobType.
NOTE: JobStreamer.JobStream.push(ActivatedJob, ErrorHandler)
is a side effect, and should be
treated as a post-commit task for consistency. TODO: see if the platform cannot already enforce
with its own implementation.
NOTE: implementations of the JobStreamer.JobStream.push(ActivatedJob, ErrorHandler)
method are
likely asynchronous. As such, errors handled via the JobStreamer.ErrorHandler
may be executed after
the initial call. Callers should be careful with the state they close on in the implementations
of their JobStreamer.ErrorHandler
.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Logic which is executed when the job cannot be pushed downstream.static interface
AJobStreamer.JobStream
allows consumers to push out activated jobs. -
Method Summary
Modifier and TypeMethodDescriptionstatic JobStreamer
noop()
default void
notifyWorkAvailable
(String jobType) Can be used to notify listeners that there are jobs available for activation.streamFor
(org.agrona.DirectBuffer jobType) Returns a job stream for the job type, orOptional.empty()
if there is none.
-
Method Details
-
noop
-
notifyWorkAvailable
Can be used to notify listeners that there are jobs available for activation.- Parameters:
jobType
- the type of the stream which has items available
-
streamFor
Returns a job stream for the job type, orOptional.empty()
if there is none.
-