async-service-supervisor 0.17.0 → 0.18.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: df5a5c251964d3435c184c712d4ccc2aa8c74a255d78f3632669a1a527ce78af
4
- data.tar.gz: ea832f3d1e9136ccca58f5c5025fe180de773389a739d9b0ad99aae453df2ee2
3
+ metadata.gz: 6a0086a1c1f5816a02f4d611debc76dbb5ca57d61add0ae50c95a5c94169b268
4
+ data.tar.gz: '07742320659e85f1931e75929de111362d503ec3e1f32cda7c4971d0459a95d0'
5
5
  SHA512:
6
- metadata.gz: f54af527ecda8c37129a39f6061095cbaf66b47eec102fd21c1aecb9e5791f487c3d48f567f0a0898a7168ba33bc3a60eef18f7fc1beb656640ce53e3b5f02ed
7
- data.tar.gz: a9e0b9c6e8a489665d72ed11b0af0eeca18fa7256bfbcdf9d7bef364554fcd219a15c1dbae49d073d8631a92ca023c689f91936444630198b596fcf2eae110dc
6
+ metadata.gz: d67c02d1a93dbda316a5656f832a14337e528d9532bffe28fe78bddd6fadde1181bd7dce9c164c5c602654dd29d3826c370edfd54fe4c4a54179813cb6d35af5
7
+ data.tar.gz: ad9a517628238cd27c72f5bbf3fcd044eda810b39745faa7c455cfa8cc4f2af24807ad5ecb86d597cd96b0d10b92061f33c8357851b2dd608ea7facaf792f057
checksums.yaml.gz.sig CHANGED
Binary file
@@ -56,12 +56,15 @@ module Async
56
56
  end
57
57
 
58
58
  # The supervised worker for the current process.
59
+ # @parameter state [Hash | Nil] Additional state to register with the supervisor.
59
60
  # @returns [Worker] The worker client.
60
- def supervisor_worker
61
+ def supervisor_worker(state: nil)
62
+ state = self.supervisor_worker_state.merge(state || {})
63
+
61
64
  Worker.new(
62
65
  process_id: Process.pid,
63
66
  endpoint: supervisor_endpoint,
64
- state: self.supervisor_worker_state,
67
+ state: state,
65
68
  utilization_schema: self.utilization_schema,
66
69
  utilization_registry: self.utilization_registry,
67
70
  )
@@ -70,11 +73,12 @@ module Async
70
73
  # Create a supervised worker for the given instance.
71
74
  #
72
75
  # @parameter instance [Async::Container::Instance] The container instance.
76
+ # @parameter state [Hash | Nil] Additional state to register with the supervisor.
73
77
  # @returns [Worker] The worker client.
74
- def prepare!(instance)
78
+ def prepare!(instance, state: nil)
75
79
  super(instance)
76
80
 
77
- supervisor_worker.run
81
+ supervisor_worker(state: state).run
78
82
  end
79
83
  end
80
84
  end
@@ -9,7 +9,7 @@ module Async
9
9
  module Service
10
10
  # @namespace
11
11
  module Supervisor
12
- VERSION = "0.17.0"
12
+ VERSION = "0.18.0"
13
13
  end
14
14
  end
15
15
  end
data/readme.md CHANGED
@@ -28,6 +28,10 @@ Please see the [project documentation](https://socketry.github.io/async-service-
28
28
 
29
29
  Please see the [project releases](https://socketry.github.io/async-service-supervisor/releases/index) for all releases.
30
30
 
31
+ ### v0.18.0
32
+
33
+ - Allow supervised services to merge additional worker state during preparation and worker construction.
34
+
31
35
  ### v0.17.0
32
36
 
33
37
  - Add opt-in `metrics` and `traces` providers for supervisor process metrics, utilization metrics, and worker lifecycle tracing.
@@ -69,10 +73,6 @@ Please see the [project releases](https://socketry.github.io/async-service-super
69
73
  - Add support for `Memory::Leak::Cluster` `free_size_minimum:` option.
70
74
  - Remove extraneous "Memory leak detected\!" logs.
71
75
 
72
- ### v0.9.1
73
-
74
- - Close `Call` queue if asynchronous call fails during dispatch - further messages will fail with `ClosedQueueError`.
75
-
76
76
  ## Contributing
77
77
 
78
78
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.18.0
4
+
5
+ - Allow supervised services to merge additional worker state during preparation and worker construction.
6
+
3
7
  ## v0.17.0
4
8
 
5
9
  - Add opt-in `metrics` and `traces` providers for supervisor process metrics, utilization metrics, and worker lifecycle tracing.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-service-supervisor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file