The base transport module contains code that deals with handling transports, as well as the base class that all custom transports should subclass. Transports are implemented as full Django apps, so they may define models, URLs, etc.
The base class for all transports.
All transport subclasses must take the name of the transport as a string as their first argument in the constructor, followed by the entire config dict as keyword args.
Parameters: | name (string) – The name of this transport in the settings file. |
---|
Override this in TransportBase subclasses to handle actual message sending.
Parameters: | msg (fa.models.OutgoingMessage) – The message to send. |
---|
Override this in TransportBase subclasses to handle actual batch message sending.
Parameters: | lst (list) – The messages to send, as an iterable of fa.models.OutgoingMessage. |
---|
Returns the instance of the transport with the given configured name.
Parameters: | name (string) – The name of this transport in the settings file. |
---|
Returns an iterable of all transports in the settings file.
Sends a single message to the target.
Parameters: | msg (fa.models.OutgoingMessage) – The message to send. This method automatically handles forwarding it to the correct transport. |
---|
Sends each OutgoingMessage in lst to its given transport as one or more _send_batch calls.
Parameters: | lst (list) – The list of :py:class:`~fa.models.OutgoingMessage`s to send. |
---|
Called by a transport to process an IncomingMessage from a FoneAstra device. Returns True if an app or device handled the message, False otherwise. Generally only called by custom transports.
Parameters: | msg (fa.models.IncomingMessage) – The message coming in from a transport instance. |
---|