Implements interfaces: tubes.itube.IDrain

A Listener is a drain that accepts Flows and sets them up.

Method __init__
Method flowingFrom The flow has begun from the given fount of Flows.
Method receive Receive the given flow, applying backpressure if too many connections are active.
Method flowStopped No more Flows are incoming; nothing to do.
def __init__(self, flowConnector, maxConnections=100):
ParametersflowConnectora 1-argument callable taking a Flow and returning nothing, which connects the flow.
maxConnectionsThe number of concurrent Flow objects to maintain active at once. (type: int)
def flowingFrom(self, fount):

The flow has begun from the given fount of Flows.

ParametersfountA fount of flows. One example of such a suitable fount would be the return value of tubes.protocol.flowFountFromEndpoint.
ReturnsNone, since this is a "terminal" drain, where founts of Flow must end up in order for more new connections to be established.
def receive(self, item):

Receive the given flow, applying backpressure if too many connections are active.

ParametersitemThe inbound Flow.
def flowStopped(self, reason):

No more Flows are incoming; nothing to do.

Parametersreasonthe reason the flow stopped.
API Documentation for tubes, generated by pydoctor at 2016-01-18 07:46:47.