Module: Kinetic::DSL
- Includes:
- Configuration
- Included in:
- Base
- Defined in:
- lib/kinetic/dsl.rb,
lib/kinetic/dsl/configuration.rb
Defined Under Namespace
Modules: Configuration
Instance Method Summary collapse
- #after_fork(&block) ⇒ Object
-
#logger ⇒ Logger
Returns the application logger instance.
-
#on_direct(key) {|message| ... } ⇒ Object
(also: #on)
Defines a direct queue subscription.
Methods included from Configuration
Instance Method Details
#after_fork(&block) ⇒ Object
8 9 10 11 |
# File 'lib/kinetic/dsl.rb', line 8 def after_fork(&block) raise Kinetic::Errors::BlockMissing unless block_given? after_fork_procs << block end |
#logger ⇒ Logger
Returns the application logger instance
34 35 36 |
# File 'lib/kinetic/dsl.rb', line 34 def logger @logger ||= config[:logging] ? reopen_logger : Logger.new('/dev/null') end |
#on_direct(key) {|message| ... } ⇒ Object Also known as: on
Defines a direct queue subscription. Direct queues do not allow fuzzy matching so all messages sent to this queue must exactly match the key.
24 25 26 27 28 29 |
# File 'lib/kinetic/dsl.rb', line 24 def on_direct(key, &block) raise Kinetic::Errors::NoSubscriberBlock unless block_given? raise Kinetic::Errors::KeyMustBeString unless key.is_a? String logger.debug "Setting up '#{key}' on 'direct'" direct[key] = block end |