GNU Info

Info Node: (python2.1-lib.info)Queue Objects

(python2.1-lib.info)Queue Objects


Prev: Queue Up: Queue
Enter node , (file) or (file)node

Queue Objects
-------------

Class `Queue' implements queue objects and has the methods described
below.  This class can be derived from in order to implement other
queue organizations (e.g. stack) but the inheritable interface is not
described here.  See the source code for details.  The public methods
are:

`qsize()'
     Return the approximate size of the queue.  Because of
     multithreading semantics, this number is not reliable.

`empty()'
     Return `1' if the queue is empty, `0' otherwise.  Because of
     multithreading semantics, this is not reliable.

`full()'
     Return `1' if the queue is full, `0' otherwise.  Because of
     multithreading semantics, this is not reliable.

`put(item[, block])'
     Put ITEM into the queue.  If optional argument BLOCK is 1 (the
     default), block if necessary until a free slot is available.
     Otherwise (BLOCK is 0), put ITEM on the queue if a free slot is
     immediately available, else raise the `Full' exception.

`put_nowait(item)'
     Equivalent to `put(ITEM, 0)'.

`get([block])'
     Remove and return an item from the queue.  If optional argument
     BLOCK is 1 (the default), block if necessary until an item is
     available.  Otherwise (BLOCK is 0), return an item if one is
     immediately available, else raise the `Empty' exception.

`get_nowait()'
     Equivalent to `get(0)'.


automatically generated by info2www version 1.2.2.9