Class: Queue
- Inherits:
-
Object
- Object
- Queue
- Defined in:
- lib/hrr_rb_ssh/compat/ruby/queue.rb
Instance Method Summary collapse
- #__deq__ ⇒ Object
- #__enq__ ⇒ Object
- #close ⇒ Object
- #closed? ⇒ Boolean
- #deq ⇒ Object
- #enq(arg) ⇒ Object
Instance Method Details
#__deq__ ⇒ Object
12 |
# File 'lib/hrr_rb_ssh/compat/ruby/queue.rb', line 12 alias_method :__deq__, :deq |
#__enq__ ⇒ Object
11 |
# File 'lib/hrr_rb_ssh/compat/ruby/queue.rb', line 11 alias_method :__enq__, :enq |
#close ⇒ Object
14 15 16 |
# File 'lib/hrr_rb_ssh/compat/ruby/queue.rb', line 14 def close @closed = true end |
#closed? ⇒ Boolean
18 19 20 |
# File 'lib/hrr_rb_ssh/compat/ruby/queue.rb', line 18 def closed? @closed == true end |
#deq ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/hrr_rb_ssh/compat/ruby/queue.rb', line 27 def deq begin Timeout.timeout(0.1) do __deq__ end rescue Timeout::Error return nil if @closed == true retry end end |
#enq(arg) ⇒ Object
22 23 24 25 |
# File 'lib/hrr_rb_ssh/compat/ruby/queue.rb', line 22 def enq arg raise ClosedQueueError if @closed == true __enq__ arg end |