Class t.p.a._DispatchMixin:

Part of twisted.protocols.amp View Source View In Hierarchy

Known subclasses: twisted.protocols.amp._AmpParserBase

I help AMP dispatch commands based on strings.
Method _wrapWithSerialization Wrap aCallable with its command's argument de-serialization
Method lookupFunction Return a callable to invoke when executing the named command.
Method dispatchCommand A box with a _command key was received.
def _wrapWithSerialization(self, aCallable, command): (source)
Wrap aCallable with its command's argument de-serialization and result serialization logic.
ParametersaCallablea callable with a 'command' attribute, designed to be called with keyword arguments.
commandthe command class whose serialization to use.
Returnsa 1-arg callable which, when invoked with an AmpBox, will deserialize the argument list and invoke appropriate user code for the callable's command, returning a Deferred which fires with the result or fails with an error.
def lookupFunction(self, name): (source)
Return a callable to invoke when executing the named command.
Parametersnamethe normalized name (from the wire) of the command.
Returnsa function that takes one argument (a Box) and returns a box, for handling the command identified by the given name.
def dispatchCommand(self, box): (source)

A box with a _command key was received.

Dispatch it to a local handler call it.
Parametersprotoan AMP instance.
boxan AmpBox to be dispatched.
API Documentation for twisted, generated by pydoctor.