- 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 Summary
-
Method Summary
Modifier and Type Method Description default CLTask
andThen(CLTask after)
Cascade two steps.void
enqueue(CLCommandQueue q, CLEventList wait, CLEventList event)
Enqueue the job.static CLTask
ofFlush()
static CLTask
ofNOP()
static java.util.stream.Collector<CLTask,java.util.List<CLTask>,CLTask>
toTask()
static CLTask
toTask(java.util.List<CLTask> list)
-
Field Details
-
NOP
-
FLUSH
-
-
Method Details
-
enqueue
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
Cascade two steps.- Parameters:
after
- Task to run after this one.- Returns:
-
toTask
-
ofNOP
-
ofFlush
-
toTask
-