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.3.pre.rc6-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc6 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc5-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc5 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc4-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc4 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc3-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc3 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc2-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc2 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2.pre.rc5-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2.pre.rc5 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2.pre.rc4-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2.pre.rc4 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2.pre.rc3-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.2.pre.rc3 lib/splitclient-rb/engine/status_manager.rb