Module pprocess :: Class Queue
[hide private]
[frames] | no frames]

Class Queue

source code

Exchange --+
           |
          Queue
Known Subclasses:


An exchange acting as a queue, making data from created processes available
in the order in which it is received.

Instance Methods [hide private]
 
__init__(self, *args, **kw)
Initialise the exchange with an optional list of 'channels'.
source code
 
store_data(self, channel)
Accumulate the incoming data, associating results with channels.
source code
 
__iter__(self) source code
 
next(self)
Return the next element in the queue.
source code
 
__len__(self)
Return the current length of the queue.
source code

Inherited from Exchange: active, add, add_wait, busy, create, finish, manage, ready, remove, start, start_waiting, store, unfinished, wait

Method Details [hide private]

__init__(self, *args, **kw)
(Constructor)

source code 

Initialise the exchange with an optional list of 'channels'.

If the optional 'limit' is specified, restrictions on the addition of
new channels can be enforced and observed through the 'add_wait', 'wait'
and 'finish' methods. To make use of these methods, create a subclass of
this class and define a working 'store_data' method.

If the optional 'reuse' parameter is set to a true value, channels and
processes will be reused for waiting computations, but the callable will
be invoked for each computation.

If the optional 'continuous' parameter is set to a true value, channels
and processes will be retained after receiving data sent from such
processes, since it will be assumed that they will communicate more
data.

If the optional 'autoclose' parameter is set to a false value, channels
will not be closed automatically when they are removed from the exchange
- by default they are closed when removed.

Overrides: Exchange.__init__
(inherited documentation)

store_data(self, channel)

source code 
Accumulate the incoming data, associating results with channels.

Overrides: Exchange.store_data