Multiple concurrent streaming connections, best practices


#1

I am creating an application that will allow clients to access streams tracking multiple terms.

Since 1 application can only make 1 streaming connection, how would I offer this services to multiple clients tracking different sets of terms?

I hope to abstract out the process of registering an application, or having them authenticate in order to keep my application as simple and full service as possible.

Are there any practices for this use of the API? Or must I register an application manually for each client?

Thank you for your help!


#2

Hi there,

[node:14935] has some useful explanation on this topic.

Since you have to disconnect to change track terms, many set up a system where they kind of “trade” connections when they’re ready to change terms – you’ll have Stream A connected via User A and Application A with terms X and Y. Then when you want to start tracking Z, you’ll connect Stream B via User A and Application A and disconnect Stream A. Stream B is now your Stream A.

Even though you don’t use direct end user accounts to connect to the streaming API, it can still be useful to require authentication – it’s your primary means to grow your usage of the API with the size of your userbase – often you’ll need to backfill results or otherwise use the REST API to monitor change in tweets over time.