Class: OpenC3::QueueBase

Inherits:
Object show all
Defined in:
lib/openc3/microservices/reaction_microservice.rb

Overview

This should remain a thread safe implementation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope:) ⇒ QueueBase

Returns a new instance of QueueBase.



174
175
176
# File 'lib/openc3/microservices/reaction_microservice.rb', line 174

def initialize(scope:)
  @queue = Queue.new
end

Instance Attribute Details

#queueObject (readonly)

Returns the value of attribute queue.



172
173
174
# File 'lib/openc3/microservices/reaction_microservice.rb', line 172

def queue
  @queue
end

Instance Method Details

#enqueue(kind:, data:) ⇒ Object



178
179
180
# File 'lib/openc3/microservices/reaction_microservice.rb', line 178

def enqueue(kind:, data:)
  @queue << [kind, data]
end