diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-07 12:23:23 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-07 12:23:23 +0200 |
commit | 489df8f0dd22043507299d02f934fe0213ca29e6 (patch) | |
tree | f09a5ae573c8c086abec8b942548533d812aa68c /src/main/TweetShell.java | |
parent | 6955aaa7c469878dc75fb80a036034eaef723e7d (diff) | |
download | TwitterDataAnalytics-489df8f0dd22043507299d02f934fe0213ca29e6.tar.gz |
Add flush command
Diffstat (limited to 'src/main/TweetShell.java')
-rw-r--r-- | src/main/TweetShell.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java index 8b801ea..e8d387d 100644 --- a/src/main/TweetShell.java +++ b/src/main/TweetShell.java @@ -5,6 +5,7 @@ import io.DataWriter; import io.OAuthRequester; import io.StreamImpl; import java.io.Closeable; +import java.io.Flushable; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -195,6 +196,7 @@ public class TweetShell implements TwitterApi.PinSupplier { keywords("Display currently active keywords"), commit("Activate the stream or apply the stream keyword changes"), status("Show some status and statistics"), + flush("Writes any pending buffers"), close("Close the stream"), exit("Returns to shell"), help("Get help"), @@ -306,6 +308,11 @@ public class TweetShell implements TwitterApi.PinSupplier { System.out.println("Received tweets in session: " + tc.getTweetCount()); System.out.println("Unique users: " + tc.getUsers().size()); break; + case flush: + if (stream_cached != null) { + resultListeners.flush(); + } + break; case close: safeClose(); break; |