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) 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) method are likely asynchronous.

  • 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, Predicate<JobActivationProperties> filter)
      Returns a job stream for the job type, or Optional.empty() if there is none.

      The predicate should return false to exclude job streams from the list of possible streams.

      Parameters:
      jobType - the job type to look for
      filter - a filter to include/exclude eligible job streams based on their properties
      Returns:
      a job stream which matches the type and given filter, or Optional.empty() if none match
    • streamFor

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