We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The example code below should expose the issue. Subscribing twice on the same channel, prevents further new subscriptions on any channel.
Calling listen() only once doesn't seem to help.
import time import random from functools import partial import brukva import tornado def start_data_producer(): now = time.time() ioloop = tornado.ioloop.IOLoop.instance() c = brukva.Client() c.connect() def pub(channel): data = random.randint(0,10) print "Publishing %s on %s" % (data, channel) c.publish(channel, data) tick = tornado.ioloop.PeriodicCallback(partial(pub, "test"), 1000) tick.start() tick2 = tornado.ioloop.PeriodicCallback(partial(pub, "test_2"), 1000) tick2.start() def run_test(): now = time.time() ioloop = tornado.ioloop.IOLoop.instance() c = brukva.Client() c.connect() def callback(result): print "Received: %s" % result.body def unsub(channel): print "=== Unsubscribing: %s ===" % channel c.unsubscribe(channel) def sub(channel): print "=== Suscribing: %s ===" % channel c.subscribe(channel) # Should listen() be called for every subscribe() call? c.listen(callback) ioloop.add_timeout(now, partial(sub, "test")) # If we don't perform this second subscribe call then all is good. ioloop.add_timeout(now + 5, partial(sub, "test")) ioloop.add_timeout(now + 10, partial(unsub, "test")) ioloop.add_timeout(now + 15, partial(sub, "test")) ioloop.add_timeout(now + 20, partial(sub, "test_2")) if __name__ == '__main__': start_data_producer() run_test() tornado.ioloop.IOLoop.instance().start()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The example code below should expose the issue. Subscribing twice on the same channel, prevents further new subscriptions on any channel.
Calling listen() only once doesn't seem to help.
The text was updated successfully, but these errors were encountered: