Module notzed.zcl
Package au.notzed.zcl

Interface CLTask

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 CLTask
Tasks are a functional(ish) interface to queueable jobs.

At its base each CLCommandQueue enqueue interface is wrapped by the target data type which defines 'of()' methods for the operations instead.

The goal is to reduce the interface size which simplifying re-use.

This is an experimental 'zcl' feature.

  • Field Details

    • NOP

      static final CLTask NOP
    • FLUSH

      static final CLTask FLUSH
  • Method Details

    • enqueue

      void enqueue​(CLCommandQueue q, CLEventList wait, CLEventList event) throws CLException
      Enqueue the job.

      Parameters:
      q - target queue.
      wait - events to wait for completion before starting, or null.
      event - target for completion event, or null.
      Throws:
      CLException
    • andThen

      default CLTask andThen​(CLTask after)
      Cascade two steps.
      Parameters:
      after - Task to run after this one.
      Returns:
    • toTask

      static CLTask toTask​(java.util.List<CLTask> list)
    • ofNOP

      static CLTask ofNOP()
    • ofFlush

      static CLTask ofFlush()
    • toTask

      static java.util.stream.Collector<CLTask,​java.util.List<CLTask>,​CLTask> toTask()