<  committed 09bbc56

  • Participants
  • Parent commits fc1622d
  • Branches default

Comments (0)

Files changed (1)

-Or here's a more elaborate example of using the {{{PublishSubscribeClient}}} in a multi-threaded context:
-import threading
-from stompclient import PublishSubscribeClient
-def frame_received(frame):
-  # Do something with the frame!
-  print "----Received Frame----\n%s\n-----" % frame
-client = PublishSubscribeClient('', 61613)
-listener = threading.Thread(target=client.listen_forever)
-# For our example, we want to wait until the server is actually listening
-client.subscribe("/queue/testing", frame_received)
-client.send("/queue/testing", "This is the body of the frame.")
-client.send("/queue/testing", '{"key": "Another frame example."}')
-Normally you probably wouldn't send messages to yourself using a message queue ... but hopefully you get the idea :)
+For more real-world examples (including subscribing/receiving frames), see the [[User Documentation]].