コード例 #1
0
ファイル: fanchat.py プロジェクト: Aeroglyphic/twisted-tubes
    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)
コード例 #2
0
ファイル: test_chatter.py プロジェクト: muthumal21/BDAMahout
    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())
コード例 #3
0
ファイル: fanchat.py プロジェクト: Aeroglyphic/twisted-tubes
 def __init__(self, name):
     self._name = name
     self._out = Out()
     self._in = In()
     self._in.fount.flowTo(self._out.drain)