Sha256: c5ea04a67db179562a987230b00f56457747387105f8406ae57329b6a933bb57

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Setup
    class Configurators
      # Class responsible for setting up Celluloid settings
      class Celluloid < Base
        # How many seconds should we wait for actors (listeners) before forcefully shutting them
        SHUTDOWN_TIME = 30

        # Sets up a Karafka logger as celluloid logger
        def setup
          ::Celluloid.logger = ::Karafka.logger
          # This is just a precaution - it should automatically close the current
          # connection and shutdown actor - but in case it didn't (hanged, etc)
          # we will kill it after waiting for some time
          ::Celluloid.shutdown_timeout = SHUTDOWN_TIME
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
karafka-1.0.0 lib/karafka/setup/configurators/celluloid.rb
karafka-1.0.0.rc1 lib/karafka/setup/configurators/celluloid.rb
karafka-0.6.0.rc2 lib/karafka/setup/configurators/celluloid.rb
karafka-0.6.0.rc1 lib/karafka/setup/configurators/celluloid.rb