Package gofer :: Package rmi :: Module threadpool :: Class IndexedQueue
[hide private]
[frames] | no frames]

Class IndexedQueue

source code

Synchronized call queue with indexed search.

Instance Methods [hide private]
 
__init__(self) source code
 
put(*args, **kwargs)
Put a call and retval in the queue.
source code
call
get(*args, **kwargs)
Read the next available call.
source code
call
find(*args, **kwargs)
Find a call result by ID.
source code
 
__notify(self) source code
 
__wait(self, timeout) source code
 
__lock(self) source code
 
__unlock(self) source code
 
__len__(*args, **kwargs) source code
Instance Variables [hide private]
Condition __condition
A condition used to synchronize the queue.
dict __dict
Provides indexed access.
list __list
Provides fifo functionality.
Method Details [hide private]

put(*args, **kwargs)

source code 

Put a call and retval in the queue. Signals threads waiting on the condition using get() or find().

Parameters:
  • call (Call) - A call to enqueue.
Decorators:
  • @conditional

get(*args, **kwargs)

source code 

Read the next available call.

Parameters:
  • blocking (bool) - Block and wait when the queue is empty.
  • timeout (int) - The time to wait when the queue is empty.
Returns: call
The next completed call.
Decorators:
  • @conditional

find(*args, **kwargs)

source code 

Find a call result by ID.

Parameters:
  • id (str) - A call ID.
  • blocking (bool) - Block and wait when the queue is empty.
  • timeout (int) - The time to wait when the queue is empty.
Returns: call
A completed call by call ID.
Decorators:
  • @conditional

__len__(*args, **kwargs)
(Length operator)

source code 
Decorators:
  • @conditional