Module: Nsqcd::Worker::ClassMethods
- Defined in:
- lib/nsqcd/worker.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Instance Method Summary collapse
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
81 82 83 |
# File 'lib/nsqcd/worker.rb', line 81 def channel @channel end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
81 82 83 |
# File 'lib/nsqcd/worker.rb', line 81 def opts @opts end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
81 82 83 |
# File 'lib/nsqcd/worker.rb', line 81 def topic @topic end |
Instance Method Details
#enqueue(msg, o = {}) ⇒ Object
87 88 89 90 |
# File 'lib/nsqcd/worker.rb', line 87 def enqueue(msg, o={}) @opts[:to_queue] ||= @topic publisher.publish(msg, o) end |
#from(o = {}) ⇒ Object
83 84 85 |
# File 'lib/nsqcd/worker.rb', line 83 def from(o ={}) @opts = o end |