Sha256: 20da2eaf3355c467401f58ffd454a2f97dc84dfa7d24281fcafed1be6a52f50c

Contents?: true

Size: 720 Bytes

Versions: 124

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  module Engine
    class StatusManager
      def initialize(config)
        @config = config
        @sdk_ready = Concurrent::CountDownLatch.new(1)
      end

      def ready?
        return true if @config.consumer?

        @sdk_ready.wait(0)
      end

      def ready!
        return if ready?

        @sdk_ready.count_down
        @config.logger.info('SplitIO SDK is ready')
      end

      def wait_until_ready(seconds = nil)
        return if @config.consumer?

        timeout = seconds || @config.block_until_ready

        raise SDKBlockerTimeoutExpiredException, 'SDK start up timeout expired' unless @sdk_ready.wait(timeout)
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
splitclient-rb-7.3.5.pre.rc4-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc4 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc3-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc3 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc2-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc2 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.5.pre.rc1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.4-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.4 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.4.pre.rc2-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.4.pre.rc2 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.4.pre.rc1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.4.pre.rc1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc18-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc18 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc17-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc17 lib/splitclient-rb/engine/status_manager.rb