class Queue: (source)
A queue for messages to be relayed.
| Instance Variable | directory |
See __init__ |
| Instance Variable | n |
A number used to form unique filenames. |
| Instance Variable | waiting |
The base filenames of messages waiting to be relayed. |
| Instance Variable | relayed |
The base filenames of messages in the process of being relayed. |
| Instance Variable | noisy |
A flag which determines whether informational log messages will be generated (True) or not (False). |
| Method | __init__ |
Initialize non-volatile state. |
| Method | __getstate__ |
Create a representation of the non-volatile state of the queue. |
| Method | __setstate__ |
Restore the non-volatile state of the queue and recreate the volatile state. |
| Method | readDirectory |
Scan the message directory for new messages. |
| Method | getWaiting |
Return the base filenames of messages waiting to be relayed. |
| Method | hasWaiting |
Return an indication of whether the queue has messages waiting to be relayed. |
| Method | getRelayed |
Return the base filenames of messages in the process of being relayed. |
| Method | setRelaying |
Mark a message as being relayed. |
| Method | setWaiting |
Mark a message as waiting to be relayed. |
| Method | addMessage |
Mark a message as waiting to be relayed unless it is in the process of being relayed. |
| Method | done |
Remove a message from the queue. |
| Method | getPath |
Return the full base pathname of a message in the queue. |
| Method | getEnvelope |
Get the envelope for a message. |
| Method | getEnvelopeFile |
Return the envelope file for a message in the queue. |
| Method | createNewMessage |
Create a new message in the queue. |
| Method | _init |
Initialize volatile state. |
True) or not (False).bool)
Initialize non-volatile state.
| Parameters | directory | The pathname of the directory holding messages in the queue. (type: bytes) |
Return an indication of whether the queue has messages waiting to be relayed.
| Returns | True if messages are waiting to be relayed. False otherwise. (type: bool) | |
Mark a message as waiting to be relayed.
| Parameters | message | The base filename of a message. (type: bytes) |
Mark a message as waiting to be relayed unless it is in the process of being relayed.
| Parameters | message | The base filename of a message. (type: bytes) |
Return the envelope file for a message in the queue.
| Parameters | message | The base filename of a message. (type: bytes) |
| Returns | The envelope file for the message. (type: file) | |
Create a new message in the queue.
| Returns | The envelope file and a message receiver for a new message in the queue. (type: 2-tuple of (0) file, (1) FileMessage) | |