Sha256: 576d7ae705899da9f2944e56708ff9056afd8935bad58ed5fe64b8877a8eca1e

Contents?: true

Size: 763 Bytes

Versions: 29

Compression:

Stored size: 763 Bytes

Contents

module SplitIoClient
  module Cache
    module Repositories
      module Events
        class RedisRepository < EventsRepository
          EVENTS_SLICE = 100

          def initialize(adapter, config)
            @adapter = adapter
            @config = config
          end

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

          def clear
            @adapter.get_from_queue(namespace_key('.events'), EVENTS_SLICE).map do |e|
              JSON.parse(e, symbolize_names: true)
            end
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
splitclient-rb-5.1.0-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.1.0 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.1.0.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.1.0.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.3-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.3 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.3.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.3.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.2-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.2 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.2.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.2.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.1.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.1.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.0-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.0 lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.0.pre.rc1-java lib/splitclient-rb/cache/repositories/events/redis_repository.rb
splitclient-rb-5.0.0.pre.rc1 lib/splitclient-rb/cache/repositories/events/redis_repository.rb