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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -13
- data/lib/redis_queued_locks/acquier/queues.rb +1 -1
- data/lib/redis_queued_locks/client.rb +1 -1
- data/lib/redis_queued_locks/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6417546d24eb5f2c7bbfffeebb506054fd96fc65ec0464ebbfdcf05db5b2972
|
4
|
+
data.tar.gz: e6ddf10eeb79dbdb9f2ed05480fa57423851cdd1ab9864a56b0d917c3c1aa533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebeb82df02afcc0a9cc9838769a20e027ab54704bb91ab84942ba71b04175554888cbd9448abc2fb5abf5343a43dfb7905f0d1e831a5566614fd67b6a8f5391b
|
7
|
+
data.tar.gz: 9052a8ed7a3a056787184e100e06a98920f4d758e169515e47021b6fdafadf69056304e0177070bd050d9586bff990f2bae394d9a27490df9bd3fe949d509ea0
|
data/CHANGELOG.md
CHANGED
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
|
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
|
-
|
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,
|
628
|
+
- contained data: `{ queue: String, requests: Array<Hash<String,Any>> }`
|
630
629
|
- `:queue` - `String` - lock key queue in Redis;
|
631
|
-
- `:
|
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
|
-
:
|
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
|
-
:
|
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
|
-
- `:
|
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
|
-
- `:
|
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:
|
@@ -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
|
-
# - :
|
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>>]
|