sockets.py
def subscribe_socket(ws):
    '''Fufill the websocket URL of /subscribe, every update notify the
       websocket and read updates from the websocket '''
    # print "A client has subscribed."
    client = Client()
    clients.append(client)

    # Give the new client the current world data
    client.put(json.dumps(myWorld.world()));

    g = gevent.spawn( read_ws, ws, client )
    try:
        while True:
            # Block here until we get something from the client's queue
            msg = client.get()
            # print "Got a message:\n%s" % msg
            ws.send(msg)
    except Exception as e:# WebSocketError as e:
        print "WS Error: %s" % e
    finally:
        clients.remove(client)
        gevent.kill(g)
Fufill the websocket URL of /subscribe, every update notify the
       websocket and read updates from the websocket 
Fufill the websocket URL of /subscribe, every update notify the
websocket and read updates from the websocket
Fufill the websocket URL of / subscribe every update notify the websocket and read updates from the websocket
def subscribe_socket(ws):
    client = Client()
    clients.append(client)
    client.put(json.dumps(myWorld.world()));
    g = gevent.spawn( read_ws, ws, client )
    try:
        while True:
            msg = client.get()
            ws.send(msg)
    except Exception as e:
        print "WS Error: %s" % e
    finally:
        clients.remove(client)
        gevent.kill(g)
def subscribe_socket ( ws ) : client = Client ( ) clients . append ( client ) client . put ( json . dumps ( myWorld . world ( ) ) ) ; g = gevent . spawn ( read_ws , ws , client ) try : while True : msg = client . get ( ) ws . send ( msg ) except Exception as e : print "WS Error: %s" % e finally : clients . remove ( client ) gevent . kill ( g )
Fufill the websocket URL of /subscribe, every update notify the
websocket and read updates from the websocket
Fufill the websocket URL of / subscribe every update notify the websocket and read updates from the websocket
'''Fufill the websocket URL of /subscribe, every update notify the
       websocket and read updates from the websocket ''' # print "A client has subscribed." # Give the new client the current world data # Block here until we get something from the client's queue # print "Got a message:\n%s" % msg # WebSocketError as e:
ws