Tweets by Geolocation
Last 10 Tweets
A user or API send filter words to a WebSocket connection; in the server is stated a connection to the client by calling the "Stream Holder" component, whose function is to manage the requested connections
The "Stream Holder" component ask for a credential calling the "Credential Pool" components, using the returned credentials we state a connection to the public Twitter API and then the system send the query with specified filter terms, as result we are receiving real time tweets related to our search, using the "Message Receiver".
The "Message Receiver" is a subject inside the observer pattern: when the Twitter connection receive a tuple, notify it to the "Message Receiver" component, and this one, to avoid blocking the thread, uses a Message Queue to communicate with the "Server Socket", i.e. put the messages in the queue and the "Server Socket" pop it from there.
This process optimize the blocking time a O(1), that is the Computational Complexity of inserting in a Queue.