Example #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)
Example #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)
Example #3
0
 def zmq_readable(self, eventfd, condition, socket, callback):
     while socket.get(zmq.EVENTS) & zmq.POLLIN:
         callback(socket)
     return True
Example #4
0
def has_data(socket):
    return socket.get(zmq.EVENTS) & zmq.POLLIN
Example #5
0
 def zmq_readable(self, eventfd, condition, socket, callback):
     while socket.get(zmq.EVENTS)  & zmq.POLLIN:
         callback(socket)
     return True
Example #6
0
def has_data(socket):
    return socket.get(zmq.EVENTS) & zmq.POLLIN
Example #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)