async-container 0.35.1 → 0.36.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 293edf1aac3945b8751879fe8b8180e7fb9bcc769f5b1bea315687f19d33ea11
4
- data.tar.gz: 60699b17d30ce273a236b0728246a10fb7bb47691d3f2b3827a0bc08c51fa097
3
+ metadata.gz: 0b7c79f742eb9268bd10341606d71dcb98855a5112ba7022d35a38618185c3ea
4
+ data.tar.gz: 37a766f7e70db3d39ae22af3a4c1e0edfc92470f7d34bc0030791d3f23d8feea
5
5
  SHA512:
6
- metadata.gz: 2febcb62a2cdce3e43e92fa0d39a943bb92ade5ef0af9401810853fdb27bca98805a75d029926bbf61de0a130da293169fc9533d091d74cd11c0d01f0ee5c296
7
- data.tar.gz: 909529d757ada40f2501f96455df4f4ecad4a739365b52ef35ef77ae449c9b6869351a73cb28e0c335ef0793fed2c35656a9e6218e1b79da73fec5d4a8b09e9c
6
+ metadata.gz: 6d538e1db3f7483707fb77b7012b293eb51e89ae7c25be6f8af738e0e5ae0f43528c2e437a322f1180fe12425560280341428e5b4264eeacda2396766b687c46
7
+ data.tar.gz: 2f405c30b3037e15c132e390bb3df865a2bfbe191d665511d9321c4ef0777245ef6146f914134addfece8fc0b279f194621bfd70c1952738b0c6e5bb461ecac8
checksums.yaml.gz.sig CHANGED
Binary file
@@ -101,23 +101,25 @@ module Async
101
101
  def self.fork(**options)
102
102
  # $stderr.puts fork: caller
103
103
  self.new(**options) do |process|
104
- ::Process.fork do
105
- # We use `Thread.current.raise(...)` so that exceptions are filtered through `Thread.handle_interrupt` correctly.
106
- Signal.trap(:INT){::Thread.current.raise(Interrupt)}
107
- Signal.trap(:TERM){::Thread.current.raise(Interrupt)} # Same as SIGINT.
108
- Signal.trap(:HUP){::Thread.current.raise(Restart)}
109
-
110
- # This could be a configuration option:
111
- ::Thread.handle_interrupt(SignalException => :immediate) do
112
- yield Instance.for(process)
113
- rescue Interrupt
114
- # Graceful exit.
115
- rescue Exception => error
116
- Console.error(self, error)
104
+ ::Thread.new do
105
+ ::Process.fork do
106
+ # We use `Thread.current.raise(...)` so that exceptions are filtered through `Thread.handle_interrupt` correctly.
107
+ Signal.trap(:INT){::Thread.current.raise(Interrupt)}
108
+ Signal.trap(:TERM){::Thread.current.raise(Interrupt)} # Same as SIGINT.
109
+ Signal.trap(:HUP){::Thread.current.raise(Restart)}
117
110
 
118
- exit!(1)
111
+ # This could be a configuration option:
112
+ ::Thread.handle_interrupt(SignalException => :immediate) do
113
+ yield Instance.for(process)
114
+ rescue Interrupt
115
+ # Graceful exit.
116
+ rescue Exception => error
117
+ Console.error(self, error)
118
+
119
+ exit!(1)
120
+ end
119
121
  end
120
- end
122
+ end.value
121
123
  end
122
124
  end
123
125
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.35.1"
8
+ VERSION = "0.36.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -28,6 +28,10 @@ Please see the [project documentation](https://socketry.github.io/async-containe
28
28
 
29
29
  Please see the [project releases](https://socketry.github.io/async-container/releases/index) for all releases.
30
30
 
31
+ ### v0.36.0
32
+
33
+ - Forked containers now fork child processes from a short-lived thread, reducing inherited scheduler and parent stack state in children.
34
+
31
35
  ### v0.35.1
32
36
 
33
37
  - **Fixed**: `Hybrid` container now stops on interrupt instead of restarting indefinitely.
@@ -64,11 +68,6 @@ Please see the [project releases](https://socketry.github.io/async-container/rel
64
68
 
65
69
  - Expose `Async::Container::Controller` `#notify`, `#container_class`, and `#graceful_stop` for testing.
66
70
 
67
- ### v0.32.0
68
-
69
- - Minor **breaking** changes to `Async::Container::Policy` interface.
70
- - Expose `Async::Container::Statistics::Rate#window`.
71
-
72
71
  ## Contributing
73
72
 
74
73
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.36.0
4
+
5
+ - Forked containers now fork child processes from a short-lived thread, reducing inherited scheduler and parent stack state in children.
6
+
3
7
  ## v0.35.1
4
8
 
5
9
  - **Fixed**: `Hybrid` container now stops on interrupt instead of restarting indefinitely.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.1
4
+ version: 0.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file