Sha256: bb20263d9d97b6ac3e50cf423fb9e74819329d58370dee40cd9e5801f0f5b450

Contents?: true

Size: 843 Bytes

Versions: 52

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  module Telemetry
    class SyncTask
      def initialize(config, telemetry_synchronizer)
        @config = config
        @telemetry_synchronizer = telemetry_synchronizer
      end

      def call
        stats_thread
      end

      private

      def stats_thread
        @config.threads[:telemetry_stats_sender] = Thread.new do
          begin
            @config.logger.info('Starting Telemetry Sync Task')

            loop do
              sleep(@config.telemetry_refresh_rate)

              @telemetry_synchronizer.synchronize_stats
            end
          rescue SplitIoClient::SDKShutdownException
            @telemetry_synchronizer.synchronize_stats

            @config.logger.info('Posting Telemetry due to shutdown')
          end
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
splitclient-rb-7.3.5.pre.rc5-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc5 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc4-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc4 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc3-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc3 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc2-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc2 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc1-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.5.pre.rc1 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.4-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.4 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.4.pre.rc2-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.4.pre.rc2 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.4.pre.rc1-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.4.pre.rc1 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.3-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.3 lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.3.pre.rc18-java lib/splitclient-rb/telemetry/sync_task.rb
splitclient-rb-7.3.3.pre.rc18 lib/splitclient-rb/telemetry/sync_task.rb