Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rogererens/c4d93006d2f1a483fed4 to your computer and use it in GitHub Desktop.
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationSession
class Component(ApplicationSession):
def onJoin(self, details):
print('session attached')
def on_event(x):
print('Got event: {}'.format(x))
yield self.subscribe(on_event, u'')
def onDisconnect(self):
if __name__ == '__main__':
from autobahn.twisted.wamp import ApplicationRunner
runner = ApplicationRunner(u'wss://', u'crossbardemo')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment