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-8.4.0-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.4.0 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.4.0.pre.rc1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.4.0.pre.rc1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.4.0.rc.1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.4.0.rc.1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.2.pre.rc2-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.2.pre.rc2 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.2.pre.rc1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.2.pre.rc1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.1.pre.rc1-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.1.pre.rc1 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.0-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.0 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.0.pre.rc3-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.0.pre.rc3 lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.0.pre.rc2-java lib/splitclient-rb/engine/status_manager.rb
splitclient-rb-8.3.0.pre.rc2 lib/splitclient-rb/engine/status_manager.rb