Class: Fuey::Reporters::NotificationQueue
- Inherits:
-
Object
- Object
- Fuey::Reporters::NotificationQueue
- Defined in:
- lib/fuey_client/fuey/reporters/notification_queue.rb
Instance Method Summary collapse
-
#initialize(redis) ⇒ NotificationQueue
constructor
A new instance of NotificationQueue.
- #publish_complete(args) ⇒ Object
- #publish_new(args) ⇒ Object
- #publish_update(args) ⇒ Object
- #update(type, *args) ⇒ Object
Constructor Details
#initialize(redis) ⇒ NotificationQueue
Returns a new instance of NotificationQueue.
7 8 9 |
# File 'lib/fuey_client/fuey/reporters/notification_queue.rb', line 7 def initialize(redis) @_redis = redis end |
Instance Method Details
#publish_complete(args) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fuey_client/fuey/reporters/notification_queue.rb', line 23 def publish_complete(args) trace = args.first = { :time => Time.now.strftime("%Y%m%d%H%M%S"), :name => trace.name, :status => trace.status, :status_message => trace., :steps => trace.steps.map(&:status).map(&:attributes) } @_redis.lpush trace.name.downcase, .to_json end |
#publish_new(args) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fuey_client/fuey/reporters/notification_queue.rb', line 35 def publish_new(args) trace_name, statuses = args[0], args[1] = { :name => trace_name, :status => "executed", :status_message => "", :steps => statuses.map(&:attributes) } @_redis.publish "fuey.trace.new", .to_json end |
#publish_update(args) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/fuey_client/fuey/reporters/notification_queue.rb', line 16 def publish_update(args) trace_name, statuses = args[0], args[1] status = statuses.first = [ trace_name, status.attributes ] @_redis.publish "fuey.trace.update", .to_json end |
#update(type, *args) ⇒ Object
11 12 13 14 |
# File 'lib/fuey_client/fuey/reporters/notification_queue.rb', line 11 def update(type, *args) self.send("publish_#{type}", args) true end |