tpx 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tpx.rb +6 -5
- 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: 1a571c89cdd3261e6803c373a8214d7ae710054a7441f033b603b420f8f51497
|
4
|
+
data.tar.gz: d72a49a7272da9959358325527d12e1586d089ca52d1997a0b9d395695c7625d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 075ecf8d191001320b17f6fa0462921cb63520133e4b26fab737c3925cd46601ea80eb9ee78064ea54776959dc8cd05efb4c5cba576fbdb795003dd267d544a5
|
7
|
+
data.tar.gz: c128ae518adfb0643033b42ad394eb1c152bb7474c7c9748e2fdd0806ae6dbca8da42efc2df93aaaab3934a1a3a828bbca49a0b6ae609940e23dcf97c819419a
|
data/lib/tpx.rb
CHANGED
@@ -7,7 +7,8 @@ module TPX
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def add(args, &block)
|
10
|
-
|
10
|
+
jid = args.shift
|
11
|
+
@exec.schedule_m_add([@q, jid, args], &block)
|
11
12
|
@cnt += 1
|
12
13
|
end
|
13
14
|
|
@@ -30,8 +31,8 @@ module TPX
|
|
30
31
|
catch(:exit) do
|
31
32
|
loop do
|
32
33
|
begin
|
33
|
-
|
34
|
-
acc << [
|
34
|
+
jid, job, args, acc = @jobs.pop
|
35
|
+
acc << [jid, job.call(*args)]
|
35
36
|
rescue => e
|
36
37
|
acc << 'ERROR'
|
37
38
|
end
|
@@ -53,9 +54,9 @@ module TPX
|
|
53
54
|
|
54
55
|
def schedule_m_add(args, &block)
|
55
56
|
acc = args[0]
|
56
|
-
|
57
|
+
jid = args[1]
|
57
58
|
args = args[2]
|
58
|
-
@jobs << [
|
59
|
+
@jobs << [jid, block, args, acc]
|
59
60
|
end
|
60
61
|
|
61
62
|
def schedule_m_read(acc, n)
|