Class: FreeMessageQueue::BaseQueue
- Inherits:
-
Object
- Object
- FreeMessageQueue::BaseQueue
- Defined in:
- lib/fmq/queues/base.rb
Overview
every queue has to have this interface
Direct Known Subclasses
FilePersistentQueue, FileQueue, ForwardQueue, LinkedQueue, RoundRobinQueue
Constant Summary collapse
- INFINITE =
This value is used to decribe that a constraint has no limit e.g.
= INFINITE
means that there is no limitation for messages (by count)
-1
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
the amount of space that is used by all messages in the queue.
-
#manager ⇒ Object
QueueManager refrence.
-
#max_messages ⇒ Object
the amount of space that is used by all messages in the queue.
-
#max_size ⇒ Object
the amount of space that is used by all messages in the queue.
-
#size ⇒ Object
readonly
the amount of space that is used by all messages in the queue.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
returns true if there is no message in the queue.
-
#initialize(manager) ⇒ BaseQueue
constructor
A new instance of BaseQueue.
Constructor Details
Instance Attribute Details
#bytes ⇒ Object (readonly)
the amount of space that is used by all messages in the queue
71 72 73 |
# File 'lib/fmq/queues/base.rb', line 71 def bytes @bytes end |
#manager ⇒ Object
QueueManager refrence
64 65 66 |
# File 'lib/fmq/queues/base.rb', line 64 def manager @manager end |
#max_messages ⇒ Object
the amount of space that is used by all messages in the queue
71 72 73 |
# File 'lib/fmq/queues/base.rb', line 71 def @max_messages end |
#max_size ⇒ Object
the amount of space that is used by all messages in the queue
71 72 73 |
# File 'lib/fmq/queues/base.rb', line 71 def max_size @max_size end |
#size ⇒ Object (readonly)
the amount of space that is used by all messages in the queue
71 72 73 |
# File 'lib/fmq/queues/base.rb', line 71 def size @size end |
Instance Method Details
#empty? ⇒ Boolean
returns true if there is no message in the queue
84 85 86 |
# File 'lib/fmq/queues/base.rb', line 84 def empty? size == 0 end |