123456789_123456789_123456789_123456789_123456789_

Module: Puma::QueueClose

Relationships & Source Files
Defined in: lib/puma/queue_close.rb

Overview

Queue#close was added in Ruby 2.3. Add a simple implementation for earlier Ruby versions.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#closed?Boolean (readonly)

[ GitHub ]

  
# File 'lib/puma/queue_close.rb', line 15

def closed?
  @closed
end

Instance Method Details

#<<(object)

Alias for #push.

[ GitHub ]

  
# File 'lib/puma/queue_close.rb', line 23

alias << push

#close

[ GitHub ]

  
# File 'lib/puma/queue_close.rb', line 12

def close
  @closed = true
end

#initialize

[ GitHub ]

  
# File 'lib/puma/queue_close.rb', line 8

def initialize
  @closed = false
  super
end

#push(object) Also known as: #<<

Raises:

[ GitHub ]

  
# File 'lib/puma/queue_close.rb', line 18

def push(object)
  @closed ||= false
  raise ClosedQueueError if @closed
  super
end