Sha256: 83bddb9211136be4513f9451d321f2d71bb020ef58dfaa10faa620c45b6f485b

Contents?: true

Size: 591 Bytes

Versions: 13

Compression:

Stored size: 591 Bytes

Contents

# frozen_string_literal: true

class Freddy
  class ResponderHandler
    def initialize(consumer, consume_thread_pool)
      @consumer = consumer
      @consume_thread_pool = consume_thread_pool
    end

    # Shutdown responder
    #
    # Stop responding to messages immediately, Waits until all workers are
    # finished and then returns.
    #
    # @return [void]
    #
    # @example
    #   responder = freddy.respond_to 'Queue' do |msg, handler|
    #   end
    #   responder.shutdown
    def shutdown
      @consumer.cancel
      @consume_thread_pool.wait(:done)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
freddy-2.4.0 lib/freddy/responder_handler.rb
freddy-2.3.0 lib/freddy/responder_handler.rb
freddy-2.2.4 lib/freddy/responder_handler.rb
freddy-2.2.3 lib/freddy/responder_handler.rb
freddy-2.2.2 lib/freddy/responder_handler.rb
freddy-2.2.1 lib/freddy/responder_handler.rb
freddy-2.2.0 lib/freddy/responder_handler.rb
freddy-2.1.0 lib/freddy/responder_handler.rb
freddy-2.0.0 lib/freddy/responder_handler.rb
freddy-1.7.0 lib/freddy/responder_handler.rb
freddy-1.6.0 lib/freddy/responder_handler.rb
freddy-1.5.0 lib/freddy/responder_handler.rb
freddy-1.4.2 lib/freddy/responder_handler.rb