This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UseCompression is very useful on non-streaming request. However, this will lead to the undesirable behavior on streaming requests because Twitter server 'buffers' messages and there are no ways to determine how many messages 'buffered'.
This commit adds UseCompressionOnStreaming option [default false] to make streaming behavior desirable and predictable.
――のように、ConnectionOptions 中の UseCompression プロパティが streaming リクエストにおいて予期しない動作を生み出す問題をオプションの追加により修正します。
どうやら Twitter サーバは gzip を受け取る user stream においてメッセージをバッファするらしく、リアルタイムでメッセージを取得できなくなります。その上、このバッファされたメッセージ数を知る方法が存在せず、接続切断時などに予測出来ない量のメッセージが消失します。これは情報収集系の bot 作成に悪影響をもたらします。そのため UseCompressionOnStreaming オプションを追加し、当面の問題に対処します。
――が、マージする前に確認できていない問題をこれを書いている最中に発見 (Stream 側でバッファされているせいで Twitter サーバから送信されている情報を十分に取れない可能性がある) しました。こちらの場合、上記の対処手段は workaround 以上の意味がない (むしろ無駄にコードを増やす有害な) ものになってしまいます。これをポストしてからパケットキャプチャでテストしてみます。それまではマージをしないようにお願い致します。