leporo / tornado-redis

Asynchronous Redis client that works within Tornado IO loop.
667 stars 163 forks source link

Stops publishing after a time #85

Open davidmir opened 9 years ago

davidmir commented 9 years ago

Hi, I'm using tornado-redis to publish GPS locations (from a smartphone). It works fine, but after a time the messages stops to publish on Redis but the Tornado receives the message. I'm using the SockJSSubscriber (for web browsers subscribers) and i'm connecting to Redis with a connection pool.

Connection Pool: CONNECTION_POOL = tornadoredis.ConnectionPool(max_connections=10, wait_for_available=True)

Subscriber variable: with tornadoredis.Client(host=settings.REDIS_HOST, port=settings.REDIS_PORT), connection_pool=CONNECTION_POOL) as conn: self.subscriber = pubsub.SockJSSubscriber(conn)

Subscribe channel (Web browsers): with tornadoredis.Client(host=settings.REDIS_HOST, port=settings.REDIS_PORT), connection_pool=CONNECTION_POOL) as conn: self.subscriber.subscribe(self.channel, self) self.subscribed = True

Publish to channel (Smartphones via websocket): with tornadoredis.Client(host=settings.REDIS_HOST, port=settings.REDIS_PORT), connection_pool=CONNECTION_POOL) as conn: self.subscriber.publish(self.channel_organization, post_data) //HERE! After a time this messages are not published to Redis

This problem can be a problem in my implementation? Or the connection to Redis can be broken and the client can no longer do publish messages?

Thanks in advance

AeroNotix commented 8 years ago

A runnable, basic example with both client and server implementations which reproduces this issue would be helpful.