Class: Adhearsion::Call::CallMessageQueue
- Defined in:
- lib/adhearsion/voip/call.rb
Overview
Wraps the Queue object (subclasses it) so we can handle runaway threads, namely those originating from using with_next_message in commands.rb - this overrides << to check for the :cancel symbol and trigger the automessaging_tainted instance variable.
Defined Under Namespace
Classes: InboxClosedException
Instance Attribute Summary collapse
-
#open ⇒ Object
readonly
Returns the value of attribute open.
Instance Method Summary collapse
- #<<(queue_obj) ⇒ Object
-
#initialize ⇒ CallMessageQueue
constructor
A new instance of CallMessageQueue.
- #pop ⇒ Object
Constructor Details
#initialize ⇒ CallMessageQueue
Returns a new instance of CallMessageQueue.
125 126 127 128 |
# File 'lib/adhearsion/voip/call.rb', line 125 def initialize @open = true super end |
Instance Attribute Details
#open ⇒ Object (readonly)
Returns the value of attribute open.
123 124 125 |
# File 'lib/adhearsion/voip/call.rb', line 123 def open @open end |
Instance Method Details
#<<(queue_obj) ⇒ Object
130 131 132 133 |
# File 'lib/adhearsion/voip/call.rb', line 130 def <<(queue_obj) @open = false if queue_obj == :cancel super(queue_obj) end |
#pop ⇒ Object
135 136 137 138 |
# File 'lib/adhearsion/voip/call.rb', line 135 def pop raise Adhearsion::Call::CallMessageQueue::InboxClosedException, "The message queue for this call has aleady been disabled." if !@open super end |