Part of twisted.internet.interfaces View Source View In Hierarchy
IStreamClientEndpointStringParserWithReactor
interface instead.
An IStreamClientEndpointStringParser
is a parser which can convert a set of string *args
and
**kwargs
into an IStreamClientEndpoint
provider.
This interface is really only useful in the context of the plugin system
for endpoints.clientFromString
.
See the document entitled "The Twisted Plugin System" for
more details on how to write a plugin.
If you place an IStreamClientEndpointStringParser
plugin in the twisted.plugins
package, that plugin's
parseStreamClient
method will be used to produce endpoints for
any description string that begins with the result of that IStreamClientEndpointStringParser
's
prefix attribute.
If a IStreamClientEndpointStringParserWithReactor
plugin and IStreamClientEndpointStringParser
plugin share the same prefix, the IStreamClientEndpointStringParserWithReactor
plugin will be preferred.
Attribute | prefix | No summary |
Method | parseStreamClient | This method is invoked by endpoints.clientFromString ,
if the type of endpoint matches the return value from this IStreamClientEndpointStringParser 's
prefix method. |
str
, the description prefix to respond to. For example,
an IStreamClientEndpointStringParser
plugin which had "foo"
for its prefix
attribute would be called for endpoint descriptions like
"foo:bar:baz"
or "foo:"
.endpoints.clientFromString
,
if the type of endpoint matches the return value from this IStreamClientEndpointStringParser
's
prefix
method.Parameters | args | The string arguments, minus the endpoint type, in the endpoint description
string, parsed according to the rules described in endpoints.quoteStringArgument .
For example, if the description were
"my-type:foo:bar:baz=qux" , args would
be ('foo','bar') |
kwargs | The string arguments from the endpoint description passed as keyword
arguments. For example, if the description were
"my-type:foo:bar:baz=qux" , kwargs would
be dict(baz='qux') . | |
Returns | a client endpoint (type: IStreamClientEndpoint ) |