com.caucho.env.actor
Class AbstractWorkerQueue<T>
java.lang.Object
com.caucho.env.actor.AbstractActorProcessor<T>
com.caucho.env.actor.AbstractWorkerQueue<T>
- All Implemented Interfaces:
- ActorProcessor<T>
public abstract class AbstractWorkerQueue<T>
- extends AbstractActorProcessor<T>
Ring-based memory queue processed by a single worker.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractWorkerQueue
public AbstractWorkerQueue(int size)
isEmpty
public final boolean isEmpty()
getSize
public final int getSize()
offer
public final boolean offer(T value)
wake
public final void wake()
getThreadName
public java.lang.String getThreadName()
- Description copied from class:
AbstractActorProcessor
- Returns the current thread name.
- Specified by:
getThreadName
in interface ActorProcessor<T>
- Overrides:
getThreadName
in class AbstractActorProcessor<T>
process
public abstract void process(T value)
- Description copied from class:
AbstractActorProcessor
- Process a single item.
- Specified by:
process
in interface ActorProcessor<T>
- Specified by:
process
in class AbstractActorProcessor<T>
onProcessComplete
public void onProcessComplete()
- Description copied from class:
AbstractActorProcessor
- Called when all items in the queue are processed. This can be
used to flush buffers.
- Specified by:
onProcessComplete
in interface ActorProcessor<T>
- Overrides:
onProcessComplete
in class AbstractActorProcessor<T>