Skip to content

Commit 2d4b05e

Browse files
committed
WIP
1 parent be54958 commit 2d4b05e

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

falcon.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Gem::Specification.new do |spec|
2828

2929
spec.add_dependency "async"
3030
spec.add_dependency "async-container", "~> 0.20"
31+
spec.add_dependency "async-container-supervisor", "~> 0.1.0"
3132
spec.add_dependency "async-http", "~> 0.75"
3233
spec.add_dependency "async-http-cache", "~> 0.4"
3334
spec.add_dependency "async-service", "~> 0.10"
3435
spec.add_dependency "bundler"
3536
spec.add_dependency "localhost", "~> 1.1"
3637
spec.add_dependency "openssl", "~> 3.0"
37-
spec.add_dependency "process-metrics", "~> 0.2"
3838
spec.add_dependency "protocol-http", "~> 0.31"
3939
spec.add_dependency "protocol-rack", "~> 0.7"
4040
spec.add_dependency "samovar", "~> 2.3"

lib/falcon/environment/supervisor.rb

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,19 @@ module Falcon
1212
module Environment
1313
# Provides an environment for hosting a supervisor which can monitor multiple applications.
1414
module Supervisor
15+
include Async::Container::Supervisor::Environment
16+
1517
# The service class to use for the supervisor.
1618
# @returns [Class]
1719
def service_class
1820
::Falcon::Service::Supervisor
1921
end
2022

21-
# The name of the supervisor
22-
# @returns [String]
23-
def name
24-
"supervisor"
25-
end
26-
2723
# The IPC path to use for communication with the supervisor.
2824
# @returns [String]
2925
def ipc_path
3026
::File.expand_path("supervisor.ipc", root)
3127
end
32-
33-
# The endpoint the supervisor will bind to.
34-
# @returns [::IO::Endpoint::Generic]
35-
def endpoint
36-
::IO::Endpoint.unix(ipc_path)
37-
end
38-
39-
# Options to use when creating the container.
40-
def container_options
41-
{restart: true, count: 1, health_check_timeout: 30}
42-
end
4328
end
4429

4530
LEGACY_ENVIRONMENTS[:supervisor] = Supervisor

lib/falcon/service/supervisor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
require "process/metrics"
77
require "json"
88

9-
require "async/service/generic"
9+
require "async/container/supervisor/service"
1010

1111
require "io/endpoint/bound_endpoint"
1212
require "io/stream"
1313

1414
module Falcon
1515
module Service
1616
# Implements a host supervisor which can restart the host services and provide various metrics about the running processes.
17-
class Supervisor < Async::Service::Generic
17+
class Supervisor < Async::Container::Supervisor::Service
1818
# Initialize the supervisor using the given environment.
1919
# @parameter environment [Build::Environment]
2020
def initialize(...)

0 commit comments

Comments
 (0)