asynchronic 4.0.1 → 4.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ec97c040ebf5305b647eb5577c5bdb273d5b374903382fb8d0269aa50d9b2c
|
4
|
+
data.tar.gz: b5b53fa01eb3fa68327959cc65dc48738b56625c3ae355ba03232fddec6df590
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9590b7f7c7d6a41a340d3cb4a9f9e5960f3b0b7424b804d494abaae97889b8855a8e176815c6d8f93bc89bddb0bb264d31a94e2436f67ba8954ca27d58a69520
|
7
|
+
data.tar.gz: 3335e3a9732b1b9cd3f2513fcdffe42a1d0c2644290dd1e2aa369d2d2f11dd4688e911e4463b29d8bcbd98c04cfcf12c433a1d84c633f998347bcd36fc98ba27
|
@@ -15,7 +15,7 @@ module Asynchronic
|
|
15
15
|
def initialize
|
16
16
|
@hash = {}
|
17
17
|
@mutex = Mutex.new
|
18
|
-
@keys_mutex =
|
18
|
+
@keys_mutex = {}
|
19
19
|
self.class.connections[object_id] = self
|
20
20
|
end
|
21
21
|
|
@@ -41,6 +41,9 @@ module Asynchronic
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def synchronize(key, &block)
|
44
|
+
mutex.synchronize do
|
45
|
+
keys_mutex[key] ||= Mutex.new
|
46
|
+
end
|
44
47
|
keys_mutex[key].synchronize(&block)
|
45
48
|
end
|
46
49
|
|
@@ -51,7 +51,7 @@ module Asynchronic
|
|
51
51
|
job = process.job
|
52
52
|
block = engine.stubs[process.type]
|
53
53
|
process.define_singleton_method :job do
|
54
|
-
MockJob.new job, process,
|
54
|
+
MockJob.new job, process, block
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -67,7 +67,7 @@ module Asynchronic
|
|
67
67
|
|
68
68
|
class MockJob < TransparentProxy
|
69
69
|
|
70
|
-
def initialize(job, process,
|
70
|
+
def initialize(job, process, block)
|
71
71
|
super job
|
72
72
|
@process = process
|
73
73
|
@block = block
|
data/lib/asynchronic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asynchronic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ost
|