Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eventmachine to 1.0.7 and adapt to new BufferedTokenizer api #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/twitter/json_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

module Twitter
class JSONStream < EventMachine::Connection
MAX_LINE_LENGTH = 1024*1024

# network failure reconnections
NF_RECONNECT_START = 0.25
NF_RECONNECT_ADD = 0.25
Expand Down Expand Up @@ -115,7 +113,7 @@ def immediate_reconnect
end

def unbind
if @state == :stream && [email protected]?
if @state == :stream
parse_stream_line(@buffer.flush)
end
schedule_reconnect if @options[:auto_reconnect] && !@gracefully_closed
Expand Down Expand Up @@ -202,7 +200,7 @@ def reset_state
@code = 0
@headers = {}
@state = :init
@buffer = BufferedTokenizer.new("\r", MAX_LINE_LENGTH)
@buffer = BufferedTokenizer.new("\r")
@stream = ''

@parser = Http::Parser.new
Expand Down
2 changes: 1 addition & 1 deletion twitter-stream.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.extra_rdoc_files = ["README.markdown", "LICENSE"]

s.add_runtime_dependency('eventmachine', ">= 0.12.8")
s.add_runtime_dependency('eventmachine', "~> 1.0.7")
s.add_runtime_dependency('simple_oauth', '~> 0.2.0')
s.add_runtime_dependency('http_parser.rb', '~> 0.5.1')
s.add_development_dependency('rspec', "~> 2.5.0")
Expand Down