Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from autobahn.asyncio.wamp import ApplicationSession
- from autobahn.asyncio.wamp import ApplicationRunner
- from asyncio import coroutine
- class PoloniexComponent(ApplicationSession):
- def onConnect(self):
- self.join(self.config.realm)
- @coroutine
- def onJoin(self, details):
- def onTrollbox(*args):
- print("Trollbox Message received:", args)
- try:
- yield from self.subscribe(onTrollbox, 'trollbox')
- except Exception as e:
- print("Could not subscribe to topic:", e)
- runner = ApplicationRunner("wss://api.poloniex.com", "realm1")
- runner.run(PoloniexComponent)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement