Class: Miasma::Models::Queuing::Queue
- Inherits:
-
Types::Model
- Object
- Types::Data
- Types::Model
- Miasma::Models::Queuing::Queue
- Defined in:
- lib/miasma/models/queuing/queue.rb
Overview
Abstract balancer
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Types::Model
Instance Method Summary collapse
-
#deliver(msg_or_msgs, options = {}) ⇒ Array<Receipt>
Deliver message(s) to the queue.
-
#receive(options = {}) ⇒ Array<Message>
Receive message(s) from the queue.
Methods inherited from Types::Model
#destroy, from_json, #id?, #initialize, #persisted?, #reload, #save
Methods included from Utils::ApiMethoding
Methods inherited from Types::Data
from_json, #from_json, #initialize, #to_json
Constructor Details
This class inherits a constructor from Miasma::Types::Model
Instance Method Details
#deliver(msg_or_msgs, options = {}) ⇒ Array<Receipt>
Deliver message(s) to the queue
34 35 36 37 |
# File 'lib/miasma/models/queuing/queue.rb', line 34 def deliver(msg_or_msgs, = {}) result = perform_delivery(msg_or_msgs, ) result.is_a?(Array) ? result : [result] end |
#receive(options = {}) ⇒ Array<Message>
Receive message(s) from the queue
43 44 45 46 |
# File 'lib/miasma/models/queuing/queue.rb', line 43 def receive( = {}) result = perform_receive() result.is_a?(Array) ? result : [result] end |