Module: RedisQueuedLocks::Acquirer::Keys Private

Defined in:
lib/redis_queued_locks/acquirer/keys.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.keys(redis_client, scan_size:) ⇒ Set<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • redis_client (RedisClient)
  • scan_size (Hash) —

    a customizable set of options

Options Hash (scan_size:):

  • (Integer)

Returns:

  • (Set<String>)

Since:

  • 1.0.0



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/redis_queued_locks/acquirer/keys.rb', line 13

def keys(redis_client, scan_size:)
  Set.new.tap do |keyset|
    # @type var keyset: Set[String]
    redis_client.scan(
      'MATCH',
      RedisQueuedLocks::Resource::KEY_PATTERN,
      count: scan_size
    ) do |key|
      keyset.add(key)
    end
  end
end