Setup Instructions
- Install Python 2.7 with Virtualenv extension
- 'virtualenv wamp' to create a new blank "wamp" Virtualenv container
- 'source wamp/bin/activate' to turn on Virtualenv container
- 'pip install crossbar' to install Crossbar.io WAMP router, will get AutobahnPython as a dependancy
- Create a new blank Crossbar.io server to use as a WAMP router
- 'mkdir server'
- 'cd server'
- 'crossbar init'
Usage Instructions
- Start the WAMP router
- 'cd server'
- 'crossbar start'
- Start the Subscriber (./subscriberApp.py)
- Start the Publisher (./publisherApp.py)
What's Going On Here
When the server is started, it is accepting all new topics published to 'realm1' without any authentication. When the subscriber joins, it is telling the server "please send me any new updates to com.example.test-topic". When the publisher joins, it starts an infinate loop of taking the current time and updating the topic 'com.example.test-topic' with that value. The server then sends those updates to the subscriber client, which prints them out.
No comments:
Post a Comment