async-service 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 +4 -4
- checksums.yaml.gz.sig +3 -3
- data/lib/async/service/configuration.rb +6 -1
- data/lib/async/service/health_checker.rb +3 -3
- data/lib/async/service/managed_service.rb +17 -10
- data/lib/async/service/version.rb +1 -1
- data/readme.md +6 -5
- data/releases.md +6 -0
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7fd9e53ca4f30c0166fb518aa104d292d67543377a6c93fa5df01b85148330d
|
|
4
|
+
data.tar.gz: ba8d1d6f6c994a40a7e7ff7536a81444faa9ebf01f087933a94ee1a3f590f6c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74126e6fff458ce042d8233f148f8dd8042d8d26fce12bfea98a6d3622310bd5f8b3216344486391cdb9a60ee38416f6c3b2061228dc0fd2384c9034fddf53e1
|
|
7
|
+
data.tar.gz: 32572d45278190114e722909e14cd1d3bf3abcb66c17e5a70d97e4a0ed85ab0f323959e93a5b1bb46955897f9fc34ea6a2de66728b96ab43ed02321a2f94245c
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
�
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
&<�'�j�',l����E�A�c,ԝ�o���9��P�d���_�mHL7���]�1��Ȳf$h��ՑZ���DE�W�y6��p/b�^���2�pk�ʻ�r��*�LR�+!c��c� T�9�S��ܢH�7�Ʒ�J M�����������ӰS�e:G��2cKUc��;(�U+�ẓ�1��.^�yF1�9_s���g�s&
|
|
2
|
+
�Xuyov����*3��'��!����H���M�A7�i����,(�f-���&|��l��#��%%��Č^��(�N���H�ሿ5���>bIhk�s���HG=�NLLXFn�$$�0_����5���3����9��3�Y�
|
|
3
|
+
|
|
@@ -28,10 +28,10 @@ module Async
|
|
|
28
28
|
# We deliberately create a fiber here, to confirm that fiber creation is working.
|
|
29
29
|
# If something has gone wrong with fiber allocation, we will crash here, and that's okay.
|
|
30
30
|
Fiber.new do
|
|
31
|
-
instance.
|
|
31
|
+
instance.healthy!
|
|
32
32
|
end.resume
|
|
33
33
|
|
|
34
|
-
sleep(timeout / 2)
|
|
34
|
+
sleep(timeout / 2.0)
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
else
|
|
@@ -39,7 +39,7 @@ module Async
|
|
|
39
39
|
yield(instance)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
instance.
|
|
42
|
+
instance.healthy!
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -59,9 +59,10 @@ module Async
|
|
|
59
59
|
# Override this method to emit metrics, logs, or perform other actions when the service preparation is complete.
|
|
60
60
|
#
|
|
61
61
|
# @parameter instance [Async::Container::Instance] The container instance.
|
|
62
|
-
# @parameter
|
|
63
|
-
def emit_prepared(instance,
|
|
62
|
+
# @parameter clock [Async::Clock] The monotonic start time from {Async::Clock.start}.
|
|
63
|
+
def emit_prepared(instance, clock)
|
|
64
64
|
# Override in subclasses as needed.
|
|
65
|
+
Console.info(self, "Prepared...", duration: clock.total)
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
# Called after the service has started running.
|
|
@@ -69,9 +70,10 @@ module Async
|
|
|
69
70
|
# Override this method to emit metrics, logs, or perform other actions when the service begins running.
|
|
70
71
|
#
|
|
71
72
|
# @parameter instance [Async::Container::Instance] The container instance.
|
|
72
|
-
# @parameter
|
|
73
|
-
def emit_running(instance,
|
|
73
|
+
# @parameter clock [Async::Clock] The monotonic start time from {Async::Clock.start}.
|
|
74
|
+
def emit_running(instance, clock)
|
|
74
75
|
# Override in subclasses as needed.
|
|
76
|
+
Console.info(self, "Running...", duration: clock.total)
|
|
75
77
|
end
|
|
76
78
|
|
|
77
79
|
# Set up the container with health checking and process title formatting.
|
|
@@ -83,22 +85,27 @@ module Async
|
|
|
83
85
|
health_check_timeout = container_options[:health_check_timeout]
|
|
84
86
|
|
|
85
87
|
container.run(**container_options) do |instance|
|
|
86
|
-
|
|
88
|
+
clock = Async::Clock.start
|
|
87
89
|
|
|
88
90
|
Async do
|
|
89
91
|
evaluator = self.environment.evaluator
|
|
92
|
+
server = nil
|
|
93
|
+
|
|
94
|
+
health_checker(instance, health_check_timeout) do
|
|
95
|
+
if server
|
|
96
|
+
instance.name = format_title(evaluator, server)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
90
99
|
|
|
91
100
|
instance.status!("Preparing...")
|
|
92
101
|
evaluator.prepare!(instance)
|
|
93
|
-
emit_prepared(instance,
|
|
102
|
+
emit_prepared(instance, clock)
|
|
94
103
|
|
|
95
104
|
instance.status!("Running...")
|
|
96
105
|
server = run(instance, evaluator)
|
|
97
|
-
emit_running(instance,
|
|
106
|
+
emit_running(instance, clock)
|
|
98
107
|
|
|
99
|
-
|
|
100
|
-
instance.name = format_title(evaluator, server)
|
|
101
|
-
end
|
|
108
|
+
instance.ready!
|
|
102
109
|
end
|
|
103
110
|
end
|
|
104
111
|
end
|
data/readme.md
CHANGED
|
@@ -29,6 +29,12 @@ Please see the [project documentation](https://socketry.github.io/async-service/
|
|
|
29
29
|
|
|
30
30
|
Please see the [project releases](https://socketry.github.io/async-service/releases/index) for all releases.
|
|
31
31
|
|
|
32
|
+
### v0.18.0
|
|
33
|
+
|
|
34
|
+
- Start health checker earlier in the process. Use `#healthy!` message instead of `#ready!`.
|
|
35
|
+
- Emit prepared and running log messages with durations (e.g. how long it took to transition to prepared and running states).
|
|
36
|
+
- `Async::Service::Configuration.build{|loader|...}` can now take an argument for more flexible configuration construction.
|
|
37
|
+
|
|
32
38
|
### v0.17.0
|
|
33
39
|
|
|
34
40
|
- `ManagedService` now sends `status!` messages during startup to prevent premature health check timeouts for slow-starting services.
|
|
@@ -72,11 +78,6 @@ Please see the [project releases](https://socketry.github.io/async-service/relea
|
|
|
72
78
|
|
|
73
79
|
- Allow builder with argument for more flexible configuration construction.
|
|
74
80
|
|
|
75
|
-
### v0.10.0
|
|
76
|
-
|
|
77
|
-
- Add `Environment::Evaluator#as_json` for JSON serialization support.
|
|
78
|
-
- Allow constructing a configuration with existing environments.
|
|
79
|
-
|
|
80
81
|
## Contributing
|
|
81
82
|
|
|
82
83
|
We welcome contributions to this project.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.18.0
|
|
4
|
+
|
|
5
|
+
- Start health checker earlier in the process. Use `#healthy!` message instead of `#ready!`.
|
|
6
|
+
- Emit prepared and running log messages with durations (e.g. how long it took to transition to prepared and running states).
|
|
7
|
+
- `Async::Service::Configuration.build{|loader|...}` can now take an argument for more flexible configuration construction.
|
|
8
|
+
|
|
3
9
|
## v0.17.0
|
|
4
10
|
|
|
5
11
|
- `ManagedService` now sends `status!` messages during startup to prevent premature health check timeouts for slow-starting services.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: async-service
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -58,14 +58,14 @@ dependencies:
|
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0.
|
|
61
|
+
version: '0.29'
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0.
|
|
68
|
+
version: '0.29'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: string-format
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
126
126
|
- !ruby/object:Gem::Version
|
|
127
127
|
version: '0'
|
|
128
128
|
requirements: []
|
|
129
|
-
rubygems_version:
|
|
129
|
+
rubygems_version: 3.6.9
|
|
130
130
|
specification_version: 4
|
|
131
131
|
summary: A service layer for Async.
|
|
132
132
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|