module Rpush::Daemon::ServiceConfigMethods
Constants
- DISPATCHERS
Public Instance Methods
batch_deliveries(value = nil)
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 12 def batch_deliveries(value = nil) return batch_deliveries? if value.nil? @batch_deliveries = value end
batch_deliveries?()
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 17 def batch_deliveries? @batch_deliveries == true end
delivery_class()
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 30 def delivery_class const_get('Delivery') end
dispatcher(name = nil, options = {})
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 21 def dispatcher(name = nil, options = {}) @dispatcher_name = name @dispatcher_options = options end
dispatcher_class()
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 26 def dispatcher_class DISPATCHERS[@dispatcher_name] || (fail NotImplementedError) end
loop_instances(app)
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 43 def loop_instances(app) (@loops || []).map do |cls, options| next unless options.key?(:if) ? options[:if].call : true cls.new(app) end.compact end
loops(classes, options = {})
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 38 def loops(classes, options = {}) classes = Array[*classes] @loops = classes.map { |cls| [cls, options] } end
new_dispatcher(app)
click to toggle source
# File lib/rpush/daemon/service_config_methods.rb, line 34 def new_dispatcher(app) dispatcher_class.new(app, delivery_class, @dispatcher_options) end