Class: OpenC3::TimelineTopic

Inherits:
Topic show all
Defined in:
lib/openc3/topics/timeline_topic.rb

Constant Summary collapse

PRIMARY_KEY =
"__openc3_timelines"

Class Method Summary collapse

Methods inherited from Topic

all_same_db_shard?, clear_topics, del, get_cnt, get_last_offset, get_newest_message, get_oldest_message, group_topics_by_db_shard, method_missing, read_topics, trim_topic, update_topic_offsets, write_ack, write_topic

Class Method Details

.write_activity(activity, scope:) ⇒ Object

Write an activity to the topic

 "timeline" => "foobar",
 "kind" => "created",
 "type" => "activity",
 "data" => {
   "name" => "foobar",
   "start" => 1621875570,
   "stop" => 1621875585,
   "kind" => "cmd",
   "data" => {"cmd"=>"INST ABORT"}
   "events" => [{"event"=>"created"}]
 }


39
40
41
# File 'lib/openc3/topics/timeline_topic.rb', line 39

def self.write_activity(activity, scope:)
  Topic.write_topic("#{scope}#{PRIMARY_KEY}", activity, '*', 1000)
end