Class: DispatchRider::Configuration
- Inherits:
-
Object
- Object
- DispatchRider::Configuration
- Defined in:
- lib/dispatch-rider/configuration.rb
Instance Attribute Summary collapse
-
#additional_info_injector ⇒ Object
Returns the value of attribute additional_info_injector.
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#error_handler ⇒ Object
Returns the value of attribute error_handler.
-
#handler_path ⇒ Object
Returns the value of attribute handler_path.
-
#log_formatter ⇒ Object
Returns the value of attribute log_formatter.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#queue_info ⇒ Object
Returns the value of attribute queue_info.
-
#queue_kind ⇒ Object
Returns the value of attribute queue_kind.
-
#subscriber ⇒ Object
Returns the value of attribute subscriber.
Instance Method Summary collapse
- #default_retry_timeout=(val) ⇒ Object
- #handlers ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dispatch-rider/configuration.rb', line 16 def initialize @handler_path = Dir.getwd + "/app/handlers" @error_handler = DispatchRider::DefaultErrorHandler @queue_kind = :file_system @queue_info = { path: "tmp/dispatch-rider-queue" } @callbacks = Callbacks::Storage.new @subscriber = DispatchRider::Subscriber @log_formatter = DispatchRider::Logging::TextFormatter.new @additional_info_injector = -> (data) { data } @logger = Logger.new(STDERR) @debug = false @callbacks.around(:dispatch_message) do |job, | Logging::LifecycleLogger.wrap_handling() do job.call end end end |
Instance Attribute Details
#additional_info_injector ⇒ Object
Returns the value of attribute additional_info_injector.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def additional_info_injector @additional_info_injector end |
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
14 15 16 |
# File 'lib/dispatch-rider/configuration.rb', line 14 def callbacks @callbacks end |
#debug ⇒ Object
Returns the value of attribute debug.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def debug @debug end |
#error_handler ⇒ Object
Returns the value of attribute error_handler.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def error_handler @error_handler end |
#handler_path ⇒ Object
Returns the value of attribute handler_path.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def handler_path @handler_path end |
#log_formatter ⇒ Object
Returns the value of attribute log_formatter.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def log_formatter @log_formatter end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def logger @logger end |
#queue_info ⇒ Object
Returns the value of attribute queue_info.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def queue_info @queue_info end |
#queue_kind ⇒ Object
Returns the value of attribute queue_kind.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def queue_kind @queue_kind end |
#subscriber ⇒ Object
Returns the value of attribute subscriber.
3 4 5 |
# File 'lib/dispatch-rider/configuration.rb', line 3 def subscriber @subscriber end |
Instance Method Details
#default_retry_timeout=(val) ⇒ Object
37 38 39 |
# File 'lib/dispatch-rider/configuration.rb', line 37 def default_retry_timeout=(val) DispatchRider::Handlers::Base.set_default_retry(val) end |
#handlers ⇒ Object
41 42 43 44 45 46 |
# File 'lib/dispatch-rider/configuration.rb', line 41 def handlers @handlers ||= begin load_handler_files DispatchRider::Handlers::Base.subclasses.map { |klass| klass.name.underscore.to_sym } end end |