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.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/dispatch-rider/configuration.rb', line 18 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.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def additional_info_injector @additional_info_injector end |
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
16 17 18 |
# File 'lib/dispatch-rider/configuration.rb', line 16 def callbacks @callbacks end |
#debug ⇒ Object
Returns the value of attribute debug.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def debug @debug end |
#error_handler ⇒ Object
Returns the value of attribute error_handler.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def error_handler @error_handler end |
#handler_path ⇒ Object
Returns the value of attribute handler_path.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def handler_path @handler_path end |
#log_formatter ⇒ Object
Returns the value of attribute log_formatter.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def log_formatter @log_formatter end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def logger @logger end |
#queue_info ⇒ Object
Returns the value of attribute queue_info.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def queue_info @queue_info end |
#queue_kind ⇒ Object
Returns the value of attribute queue_kind.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def queue_kind @queue_kind end |
#subscriber ⇒ Object
Returns the value of attribute subscriber.
5 6 7 |
# File 'lib/dispatch-rider/configuration.rb', line 5 def subscriber @subscriber end |
Instance Method Details
#default_retry_timeout=(val) ⇒ Object
39 40 41 |
# File 'lib/dispatch-rider/configuration.rb', line 39 def default_retry_timeout=(val) DispatchRider::Handlers::Base.set_default_retry(val) end |
#handlers ⇒ Object
43 44 45 46 47 48 |
# File 'lib/dispatch-rider/configuration.rb', line 43 def handlers @handlers ||= begin load_handler_files DispatchRider::Handlers::Base.subclasses.map { |klass| klass.name.underscore.to_sym } end end |