More information: http://www.cs.berkeley.edu/~mdw/proj/seda/

seda.sandStorm.api
Interface SourceIF

All Known Subinterfaces:
QueueIF, SelectSourceIF

public interface SourceIF

A SourceIF implements the 'source side' of an event queue: it supports dequeue operations only.

Author:
Matt Welsh

Method Summary
 QueueElementIF[] blocking_dequeue_all(int timeout_millis)
          This method blocks on the queue up until a timeout occurs or until an element appears on the queue.
 QueueElementIF blocking_dequeue(int timeout_millis)
          Just like blocking_dequeue_all, but returns only a single element.
 QueueElementIF[] blocking_dequeue(int timeout_millis, int num)
          This method blocks on the queue up until a timeout occurs or until an element appears on the queue.
 QueueElementIF[] dequeue_all()
          Dequeues all available elements, or returns null if there is nothing left on the queue.
 QueueElementIF dequeue()
          Dequeues the next element, or returns null if there is nothing left on the queue.
 QueueElementIF[] dequeue(int num)
          Dequeues at most num available elements, or returns null if there is nothing left on the queue.
 int size()
          Returns the number of elements waiting in this queue.
 

Method Detail

dequeue

public QueueElementIF dequeue()
Dequeues the next element, or returns null if there is nothing left on the queue.
Returns:
the next QueueElementIF on the queue

dequeue_all

public QueueElementIF[] dequeue_all()
Dequeues all available elements, or returns null if there is nothing left on the queue.
Returns:
all pending QueueElementIFs on the queue

dequeue

public QueueElementIF[] dequeue(int num)
Dequeues at most num available elements, or returns null if there is nothing left on the queue.
Returns:
At most num QueueElementIFs on the queue

blocking_dequeue

public QueueElementIF blocking_dequeue(int timeout_millis)
Just like blocking_dequeue_all, but returns only a single element.

blocking_dequeue_all

public QueueElementIF[] blocking_dequeue_all(int timeout_millis)
This method blocks on the queue up until a timeout occurs or until an element appears on the queue. It returns all elements waiting on the queue at that time.
Parameters:
timeout_millis - if timeout_millis is 0, this method will be non-blocking and will return right away, whether or not any elements are pending on the queue. If timeout_millis is -1, this method blocks forever until something is available. If timeout_millis is positive, this method will wait about that number of milliseconds before returning, but possibly a little more.
Returns:
an array of QueueElementIF's. This array will be null if no elements were pending.

blocking_dequeue

public QueueElementIF[] blocking_dequeue(int timeout_millis,
                                         int num)
This method blocks on the queue up until a timeout occurs or until an element appears on the queue. It returns at most num elements waiting on the queue at that time.

size

public int size()
Returns the number of elements waiting in this queue.

More information: http://www.cs.berkeley.edu/~mdw/proj/seda/