Sha256: b658a0f8ab0ff97832297bc2b52be4998c7a1e81a9dd83224d78fe147ef2c180

Contents?: true

Size: 866 Bytes

Versions: 12

Compression:

Stored size: 866 Bytes

Contents

module SplitIoClient
  module Cache
    module Repositories
      module Events
        class RedisRepository < EventsRepository

          def initialize(adapter)
            @adapter = adapter
          end

          def add(key, traffic_type, event_type, time, value, properties, size)
            @adapter.add_to_queue(
              namespace_key('.events'),
              { m: metadata, e: event(key, traffic_type, event_type, time, value, properties) }.to_json
            )
          end

          def clear
            @adapter.get_from_queue(namespace_key('.events'), 0).map do |e|
              JSON.parse(e, symbolize_names: true)
            end
          rescue StandardError => e
            SplitIoClient.configuration.logger.error("Exception while clearing events cache: #{e}")
            []
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
splitclient-rb-6.4.1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1.pre.rc3-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1.pre.rc3 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1.pre.rc2-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1.pre.rc2 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.1.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.0-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.0 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.0.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-6.4.0.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb