Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JobStreamer
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.

  • Method Details

    • noop

      static JobStreamer noop()
    • notifyWorkAvailable

      default void notifyWorkAvailable(String jobType)
      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

      Optional<JobStreamer.JobStream> streamFor(org.agrona.DirectBuffer jobType)
      Returns a job stream for the job type, or Optional.empty() if there is none.