redis_queued_locks 0.0.36 → 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32c3b5078ec27e7203f41fc7537a75b336d5ff25c5f6a62b27c767daf16c912f
4
- data.tar.gz: a2ebddba52834ff1bbbbd04570f8573185f3529b3afa9c88bb7b349a3fcaf1d2
3
+ metadata.gz: e6417546d24eb5f2c7bbfffeebb506054fd96fc65ec0464ebbfdcf05db5b2972
4
+ data.tar.gz: e6ddf10eeb79dbdb9f2ed05480fa57423851cdd1ab9864a56b0d917c3c1aa533
5
5
  SHA512:
6
- metadata.gz: fa8f84f8059e55209c5ec354705d6ecf3dbf4a461b3971dd300ae67301e5e4063ba5382548074279a5603226fed90e72c84b8be014b15277bbd154668236e146
7
- data.tar.gz: e2b05110dfeedbdc9d58495eaa9133156615dabe314c5f1f5226036b379f457d74998791ff60b7e91fdca7095c6f22c09f8b585f3aa0f0a71123b428b836a754
6
+ metadata.gz: ebeb82df02afcc0a9cc9838769a20e027ab54704bb91ab84942ba71b04175554888cbd9448abc2fb5abf5343a43dfb7905f0d1e831a5566614fd67b6a8f5391b
7
+ data.tar.gz: 9052a8ed7a3a056787184e100e06a98920f4d758e169515e47021b6fdafadf69056304e0177070bd050d9586bff990f2bae394d9a27490df9bd3fe949d509ea0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.37] - 2024-03-28
4
+ ### Changed
5
+ - `#queues_info`: `:contains` is renamed to `:reqeusts` in order to reflect it's domain area;
6
+
3
7
  ## [0.0.36] - 2024-03-28
4
8
  ### Added
5
9
  - Requirements:
data/README.md CHANGED
@@ -595,7 +595,9 @@ rql.keys # or rql.keys(scan_size: 123)
595
595
  - returns `Set<Hash<Symbol,Any>>` (see [#lock_info](#lock_info) and examples below for details).
596
596
  - contained data: `{ lock: String, status: Symbol, info: Hash<String,Any> }`;
597
597
  - `:lock` - `String` - lock key in Redis;
598
- - `:status` - `Symbol`- `:released` or `:alive`. The lock may become relased durign the lock info extractio process;
598
+ - `:status` - `Symbol`- `:released` or `:alive`
599
+ - the lock may become relased durign the lock info extraction process;
600
+ - `:info` for `:released` keys is empty (`{}`);
599
601
  - `:info` - `Hash<String,Any>` - lock data stored in the lock key in Redis. See [#lock_info](#lock_info) for details;
600
602
 
601
603
  ```ruby
@@ -612,11 +614,8 @@ rql.locks_info # or rql.locks_info(scan_size: 123)
612
614
  "rem_ttl"=>13998}},
613
615
  {:lock=>"rql:lock:some-lock-456",
614
616
  :status=>:released,
615
- :info=>{
616
- "acq_id"=>"rql:acq:41478/4500/4520/4360/848818f09d8c3420",
617
- "ts"=>1711607112.67106,
618
- "ini_ttl"=>15000,
619
- "rem_ttl"=>13999}}}>
617
+ :info=>{},
618
+ ...}>
620
619
  ```
621
620
 
622
621
  ---
@@ -626,24 +625,25 @@ rql.locks_info # or rql.locks_info(scan_size: 123)
626
625
  - uses redis `SCAN` under the hod;
627
626
  - accepts `scan_size:`/`Integer` option (`config[:key_extraction_batch_size]` by default);
628
627
  - returns `Set<Hash<Symbol,Any>>` (see [#queue_info](#queue_info) and examples below for details).
629
- - contained data: `{ queue: String, contains: Array<Hash<String,Any>> }`
628
+ - contained data: `{ queue: String, requests: Array<Hash<String,Any>> }`
630
629
  - `:queue` - `String` - lock key queue in Redis;
631
- - `:contains` - `Array<Hash<String,Any>>` - lock requests in the que with their acquier id and score.
630
+ - `:requests` - `Array<Hash<String,Any>>` - lock requests in the que with their acquier id and score.
632
631
 
633
632
  ```ruby
634
633
  rql.queues_info # or rql.qeuues_info(scan_size: 123)
635
634
 
636
635
  => #<Set:
637
636
  {{:queue=>"rql:lock_queue:some-lock-123",
638
- :contains=>
637
+ :requests=>
639
638
  [{"acq_id"=>"rql:acq:38529/4500/4520/4360/66093702f24a3129", "score"=>1711606640.540842},
640
639
  {"acq_id"=>"rql:acq:38529/4580/4600/4360/66093702f24a3129", "score"=>1711606640.540906},
641
640
  {"acq_id"=>"rql:acq:38529/4620/4640/4360/66093702f24a3129", "score"=>1711606640.5409632}]},
642
641
  {:queue=>"rql:lock_queue:some-lock-456",
643
- :contains=>
642
+ :requests=>
644
643
  [{"acq_id"=>"rql:acq:38529/4380/4400/4360/66093702f24a3129", "score"=>1711606640.540722},
645
644
  {"acq_id"=>"rql:acq:38529/4420/4440/4360/66093702f24a3129", "score"=>1711606640.5407748},
646
- {"acq_id"=>"rql:acq:38529/4460/4480/4360/66093702f24a3129", "score"=>1711606640.540808}]}}>
645
+ {"acq_id"=>"rql:acq:38529/4460/4480/4360/66093702f24a3129", "score"=>1711606640.540808}]},
646
+ ...}>
647
647
  ```
648
648
 
649
649
  ---
@@ -686,7 +686,7 @@ Detalized event semantics and payload structure:
686
686
  - `:lock_key` - `string` - lock name;
687
687
  - `:ts` - `integer`/`epoch` - the time when the lock was obtaiend;
688
688
  - `:acq_time` - `float`/`milliseconds` - time spent on lock acquiring;
689
- - `:meta` - `nil`/`Any` - custom metadata passed to the `lock`/`lock!` method;
689
+ - `:instrument` - `nil`/`Any` - custom data passed to the `lock`/`lock!` method as `:instrument` attribute;
690
690
  - `"redis_queued_locks.lock_hold_and_release"`
691
691
  - an event signalizes about the "hold+and+release" process
692
692
  when the lock obtained and hold by the block of logic;
@@ -697,7 +697,7 @@ Detalized event semantics and payload structure:
697
697
  - `:lock_key` - `string` - lock name;
698
698
  - `:ts` - `integer`/`epoch` - the time when lock was obtained;
699
699
  - `:acq_time` - `float`/`milliseconds` - time spent on lock acquiring;
700
- - `:meta` - `nil`/`Any` - custom metadata passed to the `lock`/`lock!` method;
700
+ - `:instrument` - `nil`/`Any` - custom data passed to the `lock`/`lock!` method as `:instrument` attribute;
701
701
  - `"redis_queued_locks.explicit_lock_release"`
702
702
  - an event signalizes about the explicit lock release (invoked via `RedisQueuedLock#unlock`);
703
703
  - payload:
@@ -67,7 +67,7 @@ module RedisQueuedLocks::Acquier::Queues
67
67
  # Step 3: push the lock queue info to the result store
68
68
  seeded_queues << {
69
69
  queue: lock_queue,
70
- contains: queue_info
70
+ requests: queue_info
71
71
  }
72
72
  end
73
73
  end
@@ -322,7 +322,7 @@ class RedisQueuedLocks::Client
322
322
  # Possible options:
323
323
  # - `true` => returns a set of hashes that represents the queue state: <queue:, containing:>
324
324
  # - :queue (String) - the lock queue key in Redis database;
325
- # - :contains (Array<Hash<String,Any>>) - queue state in redis. see #queue_info for details;
325
+ # - :requests (Array<Hash<String,Any>>) - queue state in redis. see #queue_info for details;
326
326
  # - `false` => returns a set of strings that represents an active queues
327
327
  # at the moment of Redis'es SCAN;
328
328
  # @return [Set<String>,String<Hash<Symbol,Any>>]
@@ -5,6 +5,6 @@ module RedisQueuedLocks
5
5
  #
6
6
  # @api public
7
7
  # @since 0.0.1
8
- # @version 0.0.36
9
- VERSION = '0.0.36'
8
+ # @version 0.0.37
9
+ VERSION = '0.0.37'
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_queued_locks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov