Class: OpenC3::Topic

Inherits:
Object show all
Defined in:
lib/openc3/topics/topic.rb

Class Method Summary collapse

Class Method Details

.clear_topics(topics, maxlen = 0) ⇒ Object



32
33
34
# File 'lib/openc3/topics/topic.rb', line 32

def self.clear_topics(topics, maxlen = 0)
  topics.each { |topic| EphemeralStore.xtrim(topic, maxlen) }
end

.get_cnt(topic) ⇒ Object



36
37
38
39
# File 'lib/openc3/topics/topic.rb', line 36

def self.get_cnt(topic)
  _, packet = EphemeralStore.get_newest_message(topic)
  packet ? packet["received_count"].to_i : 0
end

.method_missing(message, *args, **kwargs, &block) ⇒ Object

Delegate all unknown class methods to delegate to the EphemeralStore



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

def self.method_missing(message, *args, **kwargs, &block)
  EphemeralStore.public_send(message, *args, **kwargs, &block)
end