Class: MicroQ::Fetcher::Sqs
- Inherits:
-
Object
- Object
- MicroQ::Fetcher::Sqs
- Includes:
- Celluloid
- Defined in:
- lib/micro_q/fetchers/sqs.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_message(message, time = nil) ⇒ Object
-
#initialize(name, manager) ⇒ Sqs
constructor
A new instance of Sqs.
- #start ⇒ Object
Constructor Details
#initialize(name, manager) ⇒ Sqs
Returns a new instance of Sqs.
7 8 9 10 |
# File 'lib/micro_q/fetchers/sqs.rb', line 7 def initialize(name, manager) @name = name.to_s @manager = manager end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/micro_q/fetchers/sqs.rb', line 5 def name @name end |
Instance Method Details
#add_message(message, time = nil) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/micro_q/fetchers/sqs.rb', line 22 def (, time=nil) ['run_at'] = time.to_f if time defer do client.() end end |
#start ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/micro_q/fetchers/sqs.rb', line 12 def start defer do client..tap do || @manager.() if .any? end end after(2) { start } end |