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.rc16-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc16 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc15-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc15 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc14-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc14 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc13-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc13 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc12-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc12 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc11-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc11 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc10-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc10 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc9-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc9 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc8-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc8 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc7-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-7.3.3.pre.rc7 lib/splitclient-rb/engine/status_manager.rb