Module: Rpush::Daemon::ServiceConfigMethods
Constant Summary collapse
- DISPATCHERS =
{ :http => Rpush::Daemon::Dispatcher::Http, :tcp => Rpush::Daemon::Dispatcher::Tcp }
Instance Method Summary collapse
- #delivery_class ⇒ Object
- #dispatcher(name = nil, options = {}) ⇒ Object
- #dispatcher_class ⇒ Object
- #loops(*loops) ⇒ Object
- #new_dispatcher(app) ⇒ Object
Instance Method Details
#delivery_class ⇒ Object
18 19 20 |
# File 'lib/rpush/daemon/service_config_methods.rb', line 18 def delivery_class const_get('Delivery') end |
#dispatcher(name = nil, options = {}) ⇒ Object
9 10 11 12 |
# File 'lib/rpush/daemon/service_config_methods.rb', line 9 def dispatcher(name = nil, = {}) @dispatcher_name = name @dispatcher_options = end |
#dispatcher_class ⇒ Object
14 15 16 |
# File 'lib/rpush/daemon/service_config_methods.rb', line 14 def dispatcher_class DISPATCHERS[@dispatcher_name] || (raise NotImplementedError) end |
#loops(*loops) ⇒ Object
26 27 28 29 30 |
# File 'lib/rpush/daemon/service_config_methods.rb', line 26 def loops(*loops) @loops ||= [] @loops = loops if loops.any? @loops end |
#new_dispatcher(app) ⇒ Object
22 23 24 |
# File 'lib/rpush/daemon/service_config_methods.rb', line 22 def new_dispatcher(app) dispatcher_class.new(app, delivery_class, @dispatcher_options) end |