Package pulp :: Package messaging :: Module store :: Class PendingQueue
[hide private]
[frames] | no frames]

Class PendingQueue

source code

Persistent (local) storage of pending envelopes that have been processed of an AMQP queue. Most likely use is for messages with a future window which cannot be processed immediately.

Instance Methods [hide private]
 
__init__(self, id) source code
 
add(self, envelope)
Enqueue the specified envelope.
source code
Envelope
next(self, wait=1)
Get the next pending envelope.
source code
 
remove(self, envelope)
Remove the specified envelope and place on the uncommitted list.
source code
PendingQueue
commit(self)
Commit envelopes removed from the queue.
source code
 
load(self)
Load the in-memory queue from filesystem.
source code
int
created(self, path)
Get create timestamp.
source code
int
modified(self, path)
Get modification timestamp.
source code
 
mkdir(self)
Ensure the directory exists.
source code
str
fn(self, envelope)
Get the qualified file name for the envelope.
source code
 
lock(self) source code
 
unlock(self) source code
Class Variables [hide private]
str ROOT = '/var/lib/pulp/messaging'
The root directory used for storage.
Instance Variables [hide private]
str id
The queue id.
int lastmod
Last (directory) modification.
[Envelope,..] pending
The queue of pending envelopes.
[path,..] uncommitted
A list (removed) of files pending commit.
Method Details [hide private]

__init__(self, id)
(Constructor)

source code 
Parameters:
  • id (str) - The queue id.

add(self, envelope)

source code 

Enqueue the specified envelope.

Parameters:

next(self, wait=1)

source code 

Get the next pending envelope.

Parameters:
  • wait (int) - The number of seconds to wait for a pending item.
Returns: Envelope
An Envelope

remove(self, envelope)

source code 

Remove the specified envelope and place on the uncommitted list.

Parameters:

commit(self)

source code 

Commit envelopes removed from the queue.

Returns: PendingQueue
self

created(self, path)

source code 

Get create timestamp.

Returns: int
The file create timestamp.

modified(self, path)

source code 

Get modification timestamp.

Returns: int
The file modification timestamp.

fn(self, envelope)

source code 

Get the qualified file name for the envelope.

Parameters:
Returns: str
The absolute file path.