Class: OpenC3::QueueBase
- Defined in:
- lib/openc3/microservices/reaction_microservice.rb
Overview
This should remain a thread safe implementation.
Instance Attribute Summary collapse
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
- #enqueue(kind:, data:) ⇒ Object
-
#initialize(scope:) ⇒ QueueBase
constructor
A new instance of QueueBase.
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
#queue ⇒ Object (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 |