Ruby client: intercept tick in the consume(true)


#1

Hi,
i would like to redefine the CSDL when some one changes keywords to be tracked on twitter.

When i start the consumer.consume i need to check for changes and reconnect with a new CSDL.

Using the ruby gem i see that i’m not able to intercept your tick (to maintain connection alive) which could be useful in my case to run some check functions.
I see that onStopped, onWarning, onError works well, maybe i need something like onTick, am i right?

Cheers

Duccio


#2

The two most common ways of reconnecting with an updated stream definition are:

1. After receiving a certain number of interactions, build the new CSDL, and reconnect using the new CSDL definition. Take a look at the football.rb example to see this interaction count in action.

2. Triggering the new stream definition and reconnection from some point within your application - not the client library. One common case would be that a new user signs up to your service, and submits the keywords they wish to track. You would need to subscribe to a new stream definition in order to track their keywords.