redouane59 / twittered

Twitter API client for Java developers
Apache License 2.0
234 stars 64 forks source link

Improve TweetStreamConsumer to handle connection failures #435

Open snicoll opened 1 year ago

snicoll commented 1 year ago

Looking at the current state of affairs, TweetStreamConsumer is going to call onStreamEnded when an IOException occurs. Such (network) exception can happen for a variety of reasons and some of them are recoverable by attempting to closed and open the socket again. For instance operational-disconnect should be recoverable.

While the listener offers an exit strategy, the onus is on the user and that feels something the library could offer for everyone.

See also:

snicoll commented 1 year ago

FTR, twittered does not work at all with the Apache Async HTTP client (and perhaps any async client) due to how scribejava handles them.

You may be interested by https://github.com/scribejava/scribejava/issues/1054