Sha256: 208dd30e048f5f3242854244b036357683937c18e8bba521f116777300681d57

Contents?: true

Size: 483 Bytes

Versions: 19

Compression:

Stored size: 483 Bytes

Contents

class ClosedQueueError < StandardError; end
module Puma

  # Queue#close was added in Ruby 2.3.
  # Add a simple implementation for earlier Ruby versions.
  #
  module QueueClose
    def initialize
      @closed = false
      super
    end
    def close
      @closed = true
    end
    def closed?
      @closed
    end
    def push(object)
      @closed ||= false
      raise ClosedQueueError if @closed
      super
    end
    alias << push
  end
  ::Queue.prepend QueueClose
end

Version data entries

19 entries across 16 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/puma-5.2.2/lib/puma/queue_close.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/puma-5.2.1/lib/puma/queue_close.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/puma-5.1.1/lib/puma/queue_close.rb
puma-5.2.2-java lib/puma/queue_close.rb
puma-5.2.2 lib/puma/queue_close.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/puma-5.2.1/lib/puma/queue_close.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/puma-5.1.1/lib/puma/queue_close.rb
puma-5.2.1-java lib/puma/queue_close.rb
puma-5.2.1 lib/puma/queue_close.rb
puma-5.2.0-java lib/puma/queue_close.rb
puma-5.2.0 lib/puma/queue_close.rb
puma-5.1.1-java lib/puma/queue_close.rb
puma-5.1.1 lib/puma/queue_close.rb
puma-5.1.0-java lib/puma/queue_close.rb
puma-5.1.0 lib/puma/queue_close.rb
puma-5.0.4-java lib/puma/queue_close.rb
puma-5.0.4 lib/puma/queue_close.rb
puma-5.0.3-java lib/puma/queue_close.rb
puma-5.0.3 lib/puma/queue_close.rb