Class Twitter::JSONStream
In: lib/twitter/json_stream.rb
Parent: EventMachine::Connection

Methods

Constants

MAX_LINE_LENGTH = 1024*1024
NF_RECONNECT_START = 0.25   network failure reconnections
NF_RECONNECT_ADD = 0.25
NF_RECONNECT_MAX = 16
AF_RECONNECT_START = 10   app failure reconnections
AF_RECONNECT_MUL = 2
RECONNECT_MAX = 320
RETRIES_MAX = 10
NO_DATA_TIMEOUT = 90
DEFAULT_OPTIONS = { :method => 'GET', :path => '/', :content_type => "application/x-www-form-urlencoded", :content => '', :path => '/1/statuses/filter.json', :host => 'stream.twitter.com', :port => 443, :ssl => true, :user_agent => 'TwitterStream', :timeout => 0, :proxy => ENV['HTTP_PROXY'], :auth => nil, :oauth => {}, :filters => [], :params => {}, :auto_reconnect => true

Attributes

af_last_reconnect  [RW] 
code  [RW] 
headers  [RW] 
last_data_received_at  [RW] 
nf_last_reconnect  [RW] 
proxy  [RW] 
reconnect_retries  [RW] 

Public Class methods

Public Instance methods

Called when no data has been received for NO_DATA_TIMEOUT seconds. Reconnecting is probably in order as per the Twitter recommendations

Receives raw data from the HTTP connection and pushes it into the HTTP parser which then drives subsequent callbacks.

Protected Instance methods

Called when the status line and all headers have been read from the stream.

:filters => %w(miama lebron jesus) :oauth => {

  :consumer_key    => [key],
  :consumer_secret => [token],
  :access_key      => [access key],
  :access_secret   => [access secret]

}

Normalized query hash of escaped string keys and escaped string values nil values are skipped

Called every time a chunk of data is read from the connection once it has been opened and after the headers have been processed.

Scheme (https if ssl, http otherwise) and host part of URL

[Validate]