Package threadutils :: Module ThreadPool :: Class ThreadPool
[show private | hide private]
[frames | no frames]

Class ThreadPool

          Queue --+
                  |
ThreadPoolMixIn --+
                  |
                 ThreadPool


Create at most |maxthreads| to retrieve sites. It must be used with Queue |get| (get a ThreadFetch) and |put| (return the thread) methods.
Method Summary
  __init__(self, maxthreads, can_grow)
Create a pool of threads
  __del__(self)
  __getstate__(self)
  close(self)
Close the ThreadPool object
    Inherited from ThreadPoolMixIn
  _init_(self, maxthreads, can_grow)
  begin(self, cnt)
Begin a synchronous block.
  end(self)
Wait to finish all the threads in this pool, since the self.begin call
  execute(self, endfunction, function, *args, **argd)
Execute |function| into a diferent thread with args (positional arguments) and argd (named arguments).
  put_block(self, obj)
Returns the obj thread to the pool, intern method
    Inherited from Queue
  empty(self)
Return True if the queue is empty, False otherwise (not reliable!).
  full(self)
Return True if the queue is full, False otherwise (not reliable!).
  get(self, block, timeout)
Remove and return an item from the queue.
  get_nowait(self)
Remove and return an item from the queue without blocking.
  put(self, item, block, timeout)
Put an item into the queue.
  put_nowait(self, item)
Put an item into the queue without blocking.
  qsize(self)
Return the approximate size of the queue (not reliable!).

Method Details

__init__(self, maxthreads, can_grow=False)
(Constructor)

Create a pool of threads
Overrides:
Queue.Queue.__init__

close(self)

Close the ThreadPool object
Overrides:
threadutils.ThreadPool.ThreadPoolMixIn.close

Generated by Epydoc 2.1 on Sat Oct 14 11:50:52 2006 http://epydoc.sf.net