Poloniex doesn\'t return every message to my socket. I read the messages with the following code and sometimes I get continuous message numbers, but sometimes there are like 10
You can check this code here i made: Here. It uses Beautiful soup and dryscape. It gets it by getting on Poloniex website and waiting for some time, then gathers data from website, in our case the Trollbox. I also tried with autobahn, and this is what i got, but it looks exactly like your code, so there would probably be no improvement.
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationSession,ApplicationRunner
#prints recieved message
def tamperMessage(message):
print message
class MyComponent(ApplicationSession):
@inlineCallbacks
def onJoin(self, details):
print("session joined")
#gets message and calls tamperMessage function
def gotMessage(type, messageNumber, username, message, reputation):
tamperMessage(message)
# 1. subscribe to a topic so we receive events
try:
yield self.subscribe(gotMessage,u'trollbox')
except Exception as e:
print("could not subscribe to topic:")
runner = ApplicationRunner(url=u"wss://api.poloniex.com", realm=u"realm1")