Modifier and Type | Field and Description |
---|---|
Invoker |
background |
Invoker |
foreground |
Constructor and Description |
---|
Processor(Invoker foreground,
Invoker background) |
Modifier and Type | Method and Description |
---|---|
<T> void |
consume(java.util.function.Consumer<? super T> consumer,
T value)
Lets the specified consumer to accept the given value on the foreground thread.
|
int |
getTaskCount()
Returns a workload of both task queues.
|
<T> void |
process(Command<T> command)
Lets the specified command to produce a value on the background thread
and to accept this value on the foreground thread.
|
<T> void |
process(java.util.function.Supplier<? extends T> supplier,
java.util.function.Consumer<? super T> consumer)
Lets the specified supplier to produce a value on the background thread
and the specified consumer to accept this value on the foreground thread.
|
public <T> void consume(java.util.function.Consumer<? super T> consumer, T value)
public <T> void process(Command<T> command)
public <T> void process(java.util.function.Supplier<? extends T> supplier, java.util.function.Consumer<? super T> consumer)
public int getTaskCount()