async-service 0.22.0 → 0.23.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 +2 -1
- data/lib/async/service/generic.rb +9 -2
- data/lib/async/service/version.rb +1 -1
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 5f7f1e1833ae119be22f91c6c84073871863a49269b3173a9ed0506dbdb7afc3
|
|
4
|
+
data.tar.gz: a05e566aa7668b42991189b7bcea2f8e9e298a4a51545880e965e82256ac7d8e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64b72fff461e46bf290c993b0fbe2ca03a7014f4cecbf0af35bceb32e5303626a62bfdeb4f2bf2fe78ae07c763939ad5830e3613881af89d9b5f80e123fa20fb
|
|
7
|
+
data.tar.gz: 6e64b02a88d0bf6b07fe228cf125c1b6864f9f29d589e2c828b7bd6733a154b2c40f4ac7e83b4f715d28281d2284a331e13669925f81ff0bed1025df63d0aa76
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
bLՊ����:T�1��u�gC|Ӌ~-�zxR��,�$�زF��h��S�zYJ�Yg�/ɂx�c<�QQHoR�����-��;9X��<���4��y��E#��x#�cq�D>E��'����h.���� �y(�����l�4!�6ڷض�Jl������Y�8��lq�Ӥ랼�����p��;6��9�=����~K�q��p�`
|
|
2
|
+
Ս�C�\)���uo �dөǃ-��$*����p4%����?#��AȈ�D��oz�������F�l���\��3)��P��9Ѳ���9x
|
|
@@ -11,12 +11,19 @@ module Async
|
|
|
11
11
|
# Designed to be invoked within an {Async::Controller::Container}.
|
|
12
12
|
class Generic
|
|
13
13
|
# Convert the given environment into a service if possible.
|
|
14
|
+
#
|
|
15
|
+
# If the evaluator responds to `make_service`, it is called with the environment and its return value is used as the service. This allows environments to compose child environments and return a concrete service without a dedicated service class.
|
|
16
|
+
#
|
|
17
|
+
# Otherwise, the evaluator's `service_class` is instantiated with the environment and evaluator as arguments.
|
|
18
|
+
#
|
|
14
19
|
# @parameter environment [Environment] The environment to use to construct the service.
|
|
15
|
-
# @returns [Generic | Nil] The constructed service if the environment specifies a service class.
|
|
20
|
+
# @returns [Generic | Nil] The constructed service if the environment specifies a service class or make_service.
|
|
16
21
|
def self.wrap(environment)
|
|
17
22
|
evaluator = environment.evaluator
|
|
18
23
|
|
|
19
|
-
if evaluator.
|
|
24
|
+
if evaluator.respond_to?(:make_service)
|
|
25
|
+
return evaluator.make_service(environment)
|
|
26
|
+
elsif evaluator.key?(:service_class)
|
|
20
27
|
if service_class = evaluator.service_class
|
|
21
28
|
return service_class.new(environment, evaluator)
|
|
22
29
|
end
|
data/readme.md
CHANGED
|
@@ -31,6 +31,10 @@ Please see the [project documentation](https://socketry.github.io/async-service/
|
|
|
31
31
|
|
|
32
32
|
Please see the [project releases](https://socketry.github.io/async-service/releases/index) for all releases.
|
|
33
33
|
|
|
34
|
+
### v0.23.0
|
|
35
|
+
|
|
36
|
+
- `Async::Service::Generic.wrap` now checks for a `make_service(environment)` method on the evaluator before falling back to `service_class`. This allows environments to compose child environments and return a fully-constructed service without introducing a dedicated service class.
|
|
37
|
+
|
|
34
38
|
### v0.22.0
|
|
35
39
|
|
|
36
40
|
- Ensure process title is updated immediately after server starts in `Managed::Service`.
|
|
@@ -78,10 +82,6 @@ Please see the [project releases](https://socketry.github.io/async-service/relea
|
|
|
78
82
|
- Renamed `Async::Service::Managed::Service` -\> `Async::Service::ManagedService`.
|
|
79
83
|
- Renamed `Async::Service::Managed::Environment` -\> `Async::Service::ManagedEnvironment`.
|
|
80
84
|
|
|
81
|
-
### v0.15.1
|
|
82
|
-
|
|
83
|
-
- `Managed::Service` should run within `Async do ... end`.
|
|
84
|
-
|
|
85
85
|
## Contributing
|
|
86
86
|
|
|
87
87
|
We welcome contributions to this project.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.23.0
|
|
4
|
+
|
|
5
|
+
- `Async::Service::Generic.wrap` now checks for a `make_service(environment)` method on the evaluator before falling back to `service_class`. This allows environments to compose child environments and return a fully-constructed service without introducing a dedicated service class.
|
|
6
|
+
|
|
3
7
|
## v0.22.0
|
|
4
8
|
|
|
5
9
|
- Ensure process title is updated immediately after server starts in `Managed::Service`.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|