Method: OpenC3::TimelineModel#notify

Defined in:
lib/openc3/models/timeline_model.rb

#notify(kind:) ⇒ Object

Returns [] update the redis stream / timeline topic that something has changed.

Returns:

  • update the redis stream / timeline topic that something has changed



115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/openc3/models/timeline_model.rb', line 115

def notify(kind:)
  notification = {
    'data' => JSON.generate(as_json(:allow_nan => true)),
    'kind' => kind,
    'type' => 'timeline',
    'timeline' => @timeline_name
  }
  begin
    TimelineTopic.write_activity(notification, scope: @scope)
  rescue StandardError => e
    raise TimelineInputError.new "Failed to write to stream: #{notification}, #{e}"
  end
end