org.xsocket
Class SerializedTaskQueue

Package class diagram package SerializedTaskQueue
java.lang.Object
  extended by org.xsocket.SerializedTaskQueue

public final class SerializedTaskQueue
extends Object

Serialized Task Queue

This is a xSocket internal class and subject to change

Author:
grro@xsocket.org

Constructor Summary
SerializedTaskQueue()
           
 
Method Summary
 void performMultiThreaded(Runnable task, Executor workerpool)
          process a task multi threaded synchronized by the internal task queue.
 void performNonThreaded(Runnable task, Executor workerpool)
          process a task non threaded synchronized by the internal task queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializedTaskQueue

public SerializedTaskQueue()
Method Detail

performNonThreaded

public void performNonThreaded(Runnable task,
                               Executor workerpool)
process a task non threaded synchronized by the internal task queue. If the task queue is empty the task will be processed by the current thread. If a task running or the task queue size is not empty, the task will be executed by a dedicated thread.

Parameters:
task - the task to process
workerpool - the workerpool

performMultiThreaded

public void performMultiThreaded(Runnable task,
                                 Executor workerpool)
process a task multi threaded synchronized by the internal task queue. The task will be processed by a dedicated thread. The given worker pool can be used to perform this tasks (as well as other task of the queue).

Parameters:
task - the task to process
workerpool - the workerpool


Copyright 2010 xSocket.org