ztimer 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ztimer/version.rb +1 -1
- data/lib/ztimer.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cc86823b5b2dd2f4c36338a1e829ad1f69e8e53
|
4
|
+
data.tar.gz: a367fa1941397561bd71ea43e30f826a4d40b4ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 779760acff0501d123a3274e3e77e70ef6668a779af2e4c59204f1103072c9896248e9d04ce0227cad4da963023567ad9cd3928c6cadbc9735aff1241423028c
|
7
|
+
data.tar.gz: b91ac4c3141f59aad44b3582647502dc9cf3e6bbfafbc60ba15b3ad16f3d83e5f3fc71952f926089876d21bac3928e661fac82ea0595dab10781e2b054688e0c
|
data/lib/ztimer/version.rb
CHANGED
data/lib/ztimer.rb
CHANGED
@@ -39,7 +39,7 @@ module Ztimer
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def concurrency=(new_value)
|
42
|
-
raise ArgumentError.new("Invalid concurrency value: #{new_value}") unless new_value.is_a?(Fixnum) && new_value
|
42
|
+
raise ArgumentError.new("Invalid concurrency value: #{new_value}") unless new_value.is_a?(Fixnum) && new_value >= 1
|
43
43
|
@concurrency = new_value
|
44
44
|
end
|
45
45
|
|
@@ -59,7 +59,7 @@ module Ztimer
|
|
59
59
|
@running += 1
|
60
60
|
worker = Thread.new do
|
61
61
|
begin
|
62
|
-
while !@queue.empty? && @queue.pop(true) do
|
62
|
+
while !@queue.empty? && (slot = @queue.pop(true)) do
|
63
63
|
slot.executed_at = utc_microseconds
|
64
64
|
slot.callback.call(slot) unless slot.callback.nil?
|
65
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ztimer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Groza Sergiu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|