ractor-dispatch 0.2.0 → 0.3.0
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/ractor/dispatch/version.rb +1 -1
- data/lib/ractor/dispatch.rb +20 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3651304d92c5f1fc5612d1a16aca9c153c4bb04956eb39a1bbd575a0d2b138b8
|
|
4
|
+
data.tar.gz: 1e94335e4756f2500906feb931ebe80444603a82a4de2950b55b65a99abf5dcf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c649b4ad209cf4239cda86c8d257975ffb3a93e27ea7bd642418c20f478c2707a823a189974f9ee2ab384a5abfce62dd67f8ca49b93a089e5e326f915890d6ee
|
|
7
|
+
data.tar.gz: '0059beb09aa27024cdda1b98a056cec5c3ae68a6d54e8b8aae8d7f028135b563bcf517461f4c069a8d7ede8b88c2809631db8319ce92384ec09b8dee5c89be2a'
|
data/lib/ractor/dispatch.rb
CHANGED
|
@@ -17,8 +17,26 @@ class Ractor
|
|
|
17
17
|
|
|
18
18
|
@main = Executor.new
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
class << self
|
|
21
|
+
def main
|
|
22
|
+
@main
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def reset_main! # :nodoc:
|
|
26
|
+
@main.shutdown
|
|
27
|
+
@main = Executor.new
|
|
28
|
+
end
|
|
22
29
|
end
|
|
30
|
+
|
|
31
|
+
module ForkSafety # :nodoc:
|
|
32
|
+
def _fork
|
|
33
|
+
pid = super
|
|
34
|
+
Ractor::Dispatch.reset_main! if pid == 0
|
|
35
|
+
pid
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
private_constant :ForkSafety
|
|
39
|
+
|
|
40
|
+
Process.singleton_class.prepend(ForkSafety) if Process.respond_to?(:_fork)
|
|
23
41
|
end
|
|
24
42
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ractor-dispatch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Hawthorn
|
|
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
48
|
version: '0'
|
|
49
49
|
requirements: []
|
|
50
|
-
rubygems_version:
|
|
50
|
+
rubygems_version: 4.0.16
|
|
51
51
|
specification_version: 4
|
|
52
52
|
summary: Dispatch work to a specific Ractor and get results back
|
|
53
53
|
test_files: []
|