T - the element type to processpublic final class SingleLaneExecutor<T>
extends java.lang.Object
implements java.io.Closeable
| Constructor and Description |
|---|
SingleLaneExecutor(Scheduler pool,
Action1<? super T> action)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Iterable<? extends T> items)
Add the iterable series of items.
|
void |
add(T item)
Add an item to the queue and start the processor if necessary.
|
void |
close() |
static <T> SingleLaneExecutor<T> |
create(Scheduler scheduler,
Action1<? super T> action)
Construct a single lane executor via the given parameters.
|
public void add(T item)
item - the item to add.public void add(java.lang.Iterable<? extends T> items)
items - the iterable of itemspublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic static <T> SingleLaneExecutor<T> create(Scheduler scheduler, Action1<? super T> action)
T - the value to submitscheduler - the scheduleraction - the action to invoke with the given value