Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`mail`.`relaymanager`.`Queue``

class documentation

`class Queue: (source)`

Constructor: `Queue(directory)`

View In Hierarchy

A queue for messages to be relayed.

Method | `__getstate__` | Create a representation of the non-volatile state of the queue.
Method | `__init__` | Initialize non-volatile state.
Method | `__setstate__` | Restore the non-volatile state of the queue and recreate the volatile state.
Method | `addMessage` | Mark a message as waiting to be relayed unless it is in the process of being relayed.
Method | `createNewMessage` | Create a new message in the queue.
Method | `done` | Remove a message from the queue.
Method | `getEnvelope` | Get the envelope for a message.
Method | `getEnvelopeFile` | Return the envelope file for a message in the queue.
Method | `getPath` | Return the full base pathname of a message in the queue.
Method | `getRelayed` | Return the base filenames of messages in the process of being relayed.
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 | `readDirectory` | Scan the message directory for new messages.
Method | `setRelaying` | Mark a message as being relayed.
Method | `setWaiting` | Mark a message as waiting to be relayed.
Instance Variable | `directory` | See `__init__`
Instance Variable | `n` | A number used to form unique filenames.
Instance Variable | `noisy` | A flag which determines whether informational log messages will be generated (`True`) or not (`False`).
Instance Variable | `relayed` | The base filenames of messages in the process of being relayed.
Instance Variable | `waiting` | The base filenames of messages waiting to be relayed.
Method | `_init` | Initialize volatile state.

def __getstate__(self): (source)

Create a representation of the non-volatile state of the queue.

Returns
`dict` mapping `bytes` to `object` | The non-volatile state of the queue.

def __init__(self, directory): (source)

Initialize non-volatile state.

Parameters
directory:`bytes` | The pathname of the directory holding messages in the queue.

def __setstate__(self, state): (source)

Restore the non-volatile state of the queue and recreate the volatile state.

Parameters
state:`dict` mapping `bytes` to `object` | The non-volatile state of the queue.

def addMessage(self, message): (source)

Mark a message as waiting to be relayed unless it is in the process of being relayed.

Parameters
message:`bytes` | The base filename of a message.

def createNewMessage(self): (source)

Create a new message in the queue.

Returns
2-`tuple` of (0) file, (1) `FileMessage` | The envelope file and a message receiver for a new message in the queue.

def done(self, message): (source)

Remove a message from the queue.

Parameters
message:`bytes` | The base filename of a message.

def getEnvelope(self, message): (source)

Get the envelope for a message.

Parameters
message:`bytes` | The base filename of a message.
Returns
`list` of two `bytes` | A list containing the origination and destination addresses for the message.

def getEnvelopeFile(self, message): (source)

Return the envelope file for a message in the queue.

Parameters
message:`bytes` | The base filename of a message.
Returns
file | The envelope file for the message.

def getPath(self, message): (source)

Return the full base pathname of a message in the queue.

Parameters
message:`bytes` | The base filename of a message.
Returns
`bytes` | The full base pathname of the message.

def getRelayed(self): (source)

Return the base filenames of messages in the process of being relayed.

Returns
`list` of `bytes` | The base filenames of messages in the process of being relayed.

def getWaiting(self): (source)

Return the base filenames of messages waiting to be relayed.

Returns
`list` of `bytes` | The base filenames of messages waiting to be relayed.

def hasWaiting(self): (source)

Return an indication of whether the queue has messages waiting to be relayed.

Returns
`bool` | `True` if messages are waiting to be relayed. `False` otherwise.

def readDirectory(self): (source)

Scan the message directory for new messages.

def setRelaying(self, message): (source)

Mark a message as being relayed.

Parameters
message:`bytes` | The base filename of a message.

def setWaiting(self, message): (source)

Mark a message as waiting to be relayed.

Parameters
message:`bytes` | The base filename of a message.

directory = (source)

See `__init__`

n: `int` = (source)

A number used to form unique filenames.

noisy: `bool` = (source)

A flag which determines whether informational log messages will be generated (`True`) or not (`False`).

relayed: `dict` of `bytes` = (source)

The base filenames of messages in the process of being relayed.

waiting: `dict` of `bytes` = (source)

The base filenames of messages waiting to be relayed.

def _init(self): (source)

Initialize volatile state.