def __init__(self, hub, requestsFount, responsesDrain): self._hub = hub self._participation = {} self._in = In() self._router = Router() self._participating = {} # self._in is both commands from our own client and also messages from # other clients. requestsFount.flowTo(self._in.newDrain()) self._in.fount.flowTo(series(self, self._router.drain)) self.client = self._router.newRoute() self.client.flowTo(responsesDrain)
def __init__(self, hub, requestsFount, responsesDrain): """ Create a L{Participant}. """ self._hub = hub self._in = In() self._in.fount.flowTo(responsesDrain) self._router = Router() self._participating = {} # `self._in' is both commands from our own client and also messages # from other clients. requestsFount.flowTo(series(self, self._router.drain)) self.client = self._router.newRoute("client") self.client.flowTo(self._in.newDrain())
def __init__(self, name): self._name = name self._out = Out() self._in = In() self._in.fount.flowTo(self._out.drain)