Class: OpenC3::NotebookTopic

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

Constant Summary collapse

PRIMARY_KEY =
"__openc3_notebook"

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_entry(entry, scope:) ⇒ Object

Write a notebook event to the topic

“‘json

"type" => "notebook",
"kind" => "saved",  # saved, deleted, started, completed
"data" => {
  "target" => "INST",
  "notebook" => "EXAMPLE",
  "id" => "12345",
  "updated_at" => 1621875570000000000,
  "username" => "admin"
}

“‘



28
29
30
# File 'lib/openc3/topics/notebook_topic.rb', line 28

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