Module Expr Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias Expr Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr orelse Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Assign NameStore IfExp CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str BinOpMod Str NameLoad Return BinOpMod Str TupleLoad NameLoad NameLoad decorator_list decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body Global identifier While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Delete SubscriptDel NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Global identifier Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad TryFinally body While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Break If Call AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Num Index Num attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad finalbody Delete SubscriptDel NameLoad Index NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Global identifier If CompareEq SubscriptLoad NameLoad Index Str Str body Return Call NameLoad NameLoad NameLoad orelse Expr Call NameLoad Str ListLoad TupleLoad Str Str Return ListLoad BinOpMod Call AttributeLoad Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str attr Call NameLoad keyword NameLoad decorator_list Assign NameStore NameLoad If CompareEq NameLoad Str body Assign NameStore Str If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Num body Print NameLoad Expr Call AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num TryExcept body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num handlers ExceptHandler type NameLoad body Print TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Print BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Print BinOpMod Str NameLoad handlers ExceptHandler body Print TupleLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str NameLoad Print BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad
N/A N/A This is a websocket chat example with many servers. A client can connect to
any of the servers and their messages will be received by all clients connected
to any of the servers.

Run the examples like this:

$ python examples/chat_bridge.py tcp://127.0.0.1:12345 tcp://127.0.0.1:12346

and the servers like this (changing the port for each one obviously):

$ python examples/distributed_websocket_chat.py -p tcp://127.0.0.1:12345 -s tcp://127.0.0.1:12346 7000

So all messages are published to port 12345 and the device forwards all the
messages to 12346 where they are subscribed to
 N/A os N/A sys N/A eventlet collections defaultdict eventlet spawn_n sleep eventlet wsgi eventlet websocket eventlet.green zmq eventlet.hubs get_hub use_hub uuid uuid1 N/A N/A use_hub zeromq N/A ctx N/A N/A zmq Context IDName N/A object N/A __init__ N/A N/A self N/A N/A N/A N/A self id N/A uuid1 N/A N/A self name None N/A __str__ N/A N/A self N/A N/A N/A N/A self name N/A N/A N/A self name N/A N/A N/A str N/A self id N/A pack_message N/A N/A self msg N/A N/A N/A N/A self msg N/A unpack_message N/A N/A self msg N/A N/A N/A N/A sender message msg N/A sender_name N/A N/A N/A sender id N/A self id you said N/A %s says sender N/A N/A %s: %s N/A sender_name message N/A N/A N/A participants N/A defaultdict IDName subscribe_and_distribute N/A N/A sub_socket N/A N/A N/A participants N/A True N/A N/A msg N/A N/A sub_socket recv_pyobj N/A N/A ws name_id N/A N/A participants items N/A N/A to_send N/A N/A name_id unpack_message msg N/A to_send N/A N/A N/A N/A N/A N/A ws send to_send N/A N/A N/A N/A N/A participants N/A ws N/A handle N/A N/A ws N/A N/A N/A pub_socket N/A name_id N/A participants N/A ws N/A N/A N/A ws send N/A Connected as %s, change name with 'name: new_name' name_id N/A N/A N/A True N/A N/A m N/A N/A ws wait N/A N/A m None N/A N/A N/A N/A N/A m startswith name: N/A N/A old_name N/A str name_id N/A new_name N/A N/A N/A N/A N/A m split : 1 N/A 1 strip N/A N/A name_id name new_name N/A m N/A Changed name from %s old_name N/A N/A N/A pub_socket send_pyobj N/A N/A name_id pack_message m N/A N/A sleep N/A N/A N/A participants N/A ws N/A N/A websocket WebSocketWSGI dispatch N/A N/A environ start_response N/A N/A N/A Resolves to the web page or the websocket depending on the path. N/A port N/A N/A N/A environ N/A PATH_INFO /chat N/A N/A N/A handle environ start_response N/A N/A N/A start_response 200 OK N/A N/A content-type text/html N/A N/A N/A N/A N/A N/A open N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ websocket_chat.html read N/A dict port port N/A N/A port None N/A N/A __name__ __main__ N/A N/A usage usage: websocket_chat -p pub address -s sub address port number N/A N/A N/A len N/A sys argv 6 N/A N/A usage N/A N/A N/A sys exit 1 N/A pub_addr N/A N/A sys argv N/A 2 N/A sub_addr N/A N/A sys argv N/A 4 N/A N/A N/A port N/A int N/A N/A sys argv N/A 5 N/A N/A N/A ValueError N/A N/A N/A Error port supplied couldn't be converted to int
 usage N/A N/A N/A sys exit 1 N/A N/A N/A pub_socket N/A N/A ctx socket N/A zmq PUB N/A N/A N/A pub_socket connect pub_addr N/A N/A Publishing to %s pub_addr N/A sub_socket N/A N/A ctx socket N/A zmq SUB N/A N/A N/A sub_socket connect sub_addr N/A N/A N/A sub_socket setsockopt N/A zmq SUBSCRIBE N/A N/A Subscribing to %s sub_addr N/A N/A N/A N/A N/A Couldn't create sockets
 usage N/A N/A N/A sys exit 1 N/A N/A spawn_n subscribe_and_distribute sub_socket N/A listener N/A N/A eventlet listen N/A 127.0.0.1 port N/A N/A 
Visit http://localhost:%s/ in your websocket-capable browser.
 port N/A N/A N/A wsgi server listener dispatch