Method: OpenC3::ActivityModel#notify
- Defined in:
- lib/openc3/models/activity_model.rb
#notify(kind:, extra: nil) ⇒ Object
update the redis stream / timeline topic that something has changed
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/openc3/models/activity_model.rb', line 412 def notify(kind:, extra: nil) notification = { 'data' => JSON.generate(as_json(:allow_nan => true)), 'kind' => kind, 'type' => 'activity', 'timeline' => @name } if extra extra.each do |key, value| notification[key.to_s] = value end end begin TimelineTopic.write_activity(notification, scope: @scope) rescue StandardError => e raise ActivityError.new "Failed to write to stream: #{notification}, #{e}" end end |