예제 #1
0
def handle_socket(socket):
    print("Socket: [%s]> %s" % (time(), encode(socket)))
    name = socket.get("name", None)
    data = socket.get("data", None)
    owner = socket.get("owner", None)
    
    if owner is not None:
        emit("message", data, room=owner)
예제 #2
0
 def test_response(self, socket=i3.default_socket()):
     workspaces = socket.get('get_workspaces')
     self.assertIsNotNone(workspaces)
     for workspace in workspaces:
         self.assertTrue('name' in workspace)
예제 #3
0
 def zmq_readable(self, eventfd, condition, socket, callback):
     while socket.get(zmq.EVENTS) & zmq.POLLIN:
         callback(socket)
     return True
예제 #4
0
def has_data(socket):
    return socket.get(zmq.EVENTS) & zmq.POLLIN
예제 #5
0
 def zmq_readable(self, eventfd, condition, socket, callback):
     while socket.get(zmq.EVENTS)  & zmq.POLLIN:
         callback(socket)
     return True
예제 #6
0
def has_data(socket):
    return socket.get(zmq.EVENTS) & zmq.POLLIN
예제 #7
0
 def test_response(self, socket=i3.default_socket()):
     workspaces = socket.get('get_workspaces')
     self.assertIsNotNone(workspaces)
     for workspace in workspaces:
         self.assertTrue('name' in workspace)