async-container-supervisor 0.3.0 → 0.4.1
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 +0 -0
- data/bake/async/container/supervisor.rb +30 -0
- data/lib/async/container/supervisor/client.rb +1 -1
- data/lib/async/container/supervisor/environment.rb +2 -0
- data/lib/async/container/supervisor/supervised.rb +30 -0
- data/lib/async/container/supervisor/version.rb +1 -1
- data/lib/async/container/supervisor.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -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: bb05adfa242cb60f47bd8dbe08da5e8c7d0250c450c7e9eee8b08b8a61f1670d
|
4
|
+
data.tar.gz: 0ffabcd3c5423f52c0912dc68af62b6cd2a7d1de0c74ff6fd5cc1175413f100e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b3aba809104243badeeb0a18a9bccea0b6e49e34f1ce71b2f35c0d4f1f41718287858e6d400a869dd7ea4db9378448184084d81f4dec8363cdcc9cafce07d2
|
7
|
+
data.tar.gz: 2719f1d43025b031b577289460272d7c340ca297cf49b4325e2e095e361db926fba7a85cf6b80ff6c973f5ee464b69545c1c4d43a45f48b517c8801eb46a3c54
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
def initialize(...)
|
3
|
+
super
|
4
|
+
|
5
|
+
require "async/container/supervisor"
|
6
|
+
end
|
7
|
+
|
8
|
+
def restart
|
9
|
+
client do |connection|
|
10
|
+
connection.call(do: :restart)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def status
|
15
|
+
client do |connection|
|
16
|
+
connection.call(do: :status)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def endpoint
|
23
|
+
Async::Container::Supervisor.endpoint
|
24
|
+
end
|
25
|
+
|
26
|
+
def client(&block)
|
27
|
+
Sync do
|
28
|
+
Async::Container::Supervisor::Client.new(endpoint: self.endpoint).connect(&block)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2025, by Samuel Williams.
|
5
|
+
|
6
|
+
require "async/service/environment"
|
7
|
+
|
8
|
+
module Async
|
9
|
+
module Container
|
10
|
+
module Supervisor
|
11
|
+
module Supervised
|
12
|
+
# The IPC path to use for communication with the supervisor.
|
13
|
+
# @returns [String]
|
14
|
+
def supervisor_ipc_path
|
15
|
+
::File.expand_path("supervisor.ipc", root)
|
16
|
+
end
|
17
|
+
|
18
|
+
# The endpoint the supervisor will bind to.
|
19
|
+
# @returns [::IO::Endpoint::Generic]
|
20
|
+
def supervisor_endpoint
|
21
|
+
::IO::Endpoint.unix(supervisor_ipc_path)
|
22
|
+
end
|
23
|
+
|
24
|
+
def make_supervised_worker(instance)
|
25
|
+
Worker.new(instance, endpoint: supervisor_endpoint)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-container-supervisor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -98,6 +98,7 @@ executables: []
|
|
98
98
|
extensions: []
|
99
99
|
extra_rdoc_files: []
|
100
100
|
files:
|
101
|
+
- bake/async/container/supervisor.rb
|
101
102
|
- lib/async/container/supervisor.rb
|
102
103
|
- lib/async/container/supervisor/client.rb
|
103
104
|
- lib/async/container/supervisor/connection.rb
|
@@ -107,6 +108,7 @@ files:
|
|
107
108
|
- lib/async/container/supervisor/memory_monitor.rb
|
108
109
|
- lib/async/container/supervisor/server.rb
|
109
110
|
- lib/async/container/supervisor/service.rb
|
111
|
+
- lib/async/container/supervisor/supervised.rb
|
110
112
|
- lib/async/container/supervisor/version.rb
|
111
113
|
- lib/async/container/supervisor/worker.rb
|
112
114
|
- license.md
|
metadata.gz.sig
CHANGED
Binary file
|