Ejemplo n.º 1
0
def findBusNode(busClient, sessionClass):
    """
    Return the sessionId of a node on the message bus with the given
    C{sessionClass}, or C{None} if no node with that class is connected.
    """
    busProxy = messagebus.MessageBusRPCClient(busClient)
    for nodeId, nodeClass in sorted(busProxy.listSessions().items()):
        if nodeClass == sessionClass:
            return nodeId
    return None
Ejemplo n.º 2
0
 def testMessageBusMethods(self):
     messageBusPort = self.startMessageBus()
     node = Node(messageBusPort)
     while not node.client.isRegistered():
         node.client.poll()
     adminClient = messagebus.MessageBusRPCClient(node.client)
     xx = adminClient.listSessions()
     assert(xx == {node.client.getSessionId(): node.client.getSessionClass()})
     xx = adminClient.listQueueLengths()
     assert(xx == {node.client.getSessionId(): 0})
Ejemplo n.º 3
0
 def __init__(self, client):
     self.messagebus = messagebus.MessageBusRPCClient(client)
     self.dispatcher = None
     self._client = client
     self.nodes = {}