Package tweetoscope.tweetsProducer
Class TwitterSampledStreamReaderSingleton
java.lang.Object
tweetoscope.tweetsProducer.TweetsProducer
tweetoscope.tweetsProducer.OnlineTweetsProducer
tweetoscope.tweetsProducer.TwitterSampledStreamReaderSingleton
- All Implemented Interfaces:
Runnable
,Flow.Publisher<com.twitter.clientlib.model.Tweet>
Connects to the Twitter sampled stream endpoint that delivers a roughly 1%
random sample of publicly available Tweets in read-time. As Tweets are
received, Tweet subscribers are notified.
Requires the BEARER_TOKEN environment variable to be set to connect to the Twitter API endpoint.
To ensure only one instance of this class is created at any time, it implements the Singleton pattern.
- Author:
- Virginie Galtier
-
Field Summary
Fields inherited from class tweetoscope.tweetsProducer.OnlineTweetsProducer
BEARER_TOKEN
Fields inherited from class tweetoscope.tweetsProducer.TweetsProducer
subscribers
-
Method Summary
Methods inherited from class tweetoscope.tweetsProducer.TweetsProducer
subscribe
-
Method Details
-
getInstance
- Returns:
- single instance of the sampled Tweets producer
-
run
public void run()
-