Class: TweetStream::Daemon

Inherits:
Client
  • Object
show all
Defined in:
lib/tweetstream/daemon.rb

Constant Summary collapse

DEFAULT_NAME =
'tweetstream'.freeze
DEFAULT_OPTIONS =
{:multiple => true}

Constants inherited from Client

Client::OPTION_CALLBACKS

Instance Attribute Summary collapse

Attributes inherited from Client

#control, #control_uri, #options, #stream

Instance Method Summary collapse

Methods inherited from Client

#close_connection, #connect, #controllable?, #filter, #firehose, #follow, #links, #locations, #on, #on_anything, #on_control, #on_delete, #on_direct_message, #on_enhance_your_calm, #on_error, #on_event, #on_friends, #on_inited, #on_limit, #on_no_data_received, #on_reconnect, #on_scrub_geo, #on_stall_warning, #on_status_withheld, #on_timeline_status, #on_unauthorized, #on_user_withheld, #retweet, #sample, #sitestream, #stop, #stop_stream, #track, #userstream

Constructor Details

#initialize(name = DEFAULT_NAME, options = DEFAULT_OPTIONS) ⇒ Daemon

The daemon has an optional process name for use when querying running processes. You can also pass daemon options.


41
42
43
44
45
# File 'lib/tweetstream/daemon.rb', line 41

def initialize(name = DEFAULT_NAME, options = DEFAULT_OPTIONS)
  @app_name = name
  @daemon_options = options
  super({})
end

Instance Attribute Details

#app_nameObject

Returns the value of attribute app_name


37
38
39
# File 'lib/tweetstream/daemon.rb', line 37

def app_name
  @app_name
end

#daemon_optionsObject

Returns the value of attribute daemon_options


37
38
39
# File 'lib/tweetstream/daemon.rb', line 37

def daemon_options
  @daemon_options
end

Instance Method Details

#start(path, query_parameters = {}, &block) ⇒ Object

:nodoc:


47
48
49
50
51
# File 'lib/tweetstream/daemon.rb', line 47

def start(path, query_parameters = {}, &block) #:nodoc:
  Daemons.run_proc(@app_name, @daemon_options) do
    super(path, query_parameters, &block)
  end
end