Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 26, 2025
1 parent be54958 commit 2d4b05e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion falcon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Gem::Specification.new do |spec|

spec.add_dependency "async"
spec.add_dependency "async-container", "~> 0.20"
spec.add_dependency "async-container-supervisor", "~> 0.1.0"
spec.add_dependency "async-http", "~> 0.75"
spec.add_dependency "async-http-cache", "~> 0.4"
spec.add_dependency "async-service", "~> 0.10"
spec.add_dependency "bundler"
spec.add_dependency "localhost", "~> 1.1"
spec.add_dependency "openssl", "~> 3.0"
spec.add_dependency "process-metrics", "~> 0.2"
spec.add_dependency "protocol-http", "~> 0.31"
spec.add_dependency "protocol-rack", "~> 0.7"
spec.add_dependency "samovar", "~> 2.3"
Expand Down
19 changes: 2 additions & 17 deletions lib/falcon/environment/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,19 @@ module Falcon
module Environment
# Provides an environment for hosting a supervisor which can monitor multiple applications.
module Supervisor
include Async::Container::Supervisor::Environment

# The service class to use for the supervisor.
# @returns [Class]
def service_class
::Falcon::Service::Supervisor
end

# The name of the supervisor
# @returns [String]
def name
"supervisor"
end

# The IPC path to use for communication with the supervisor.
# @returns [String]
def ipc_path
::File.expand_path("supervisor.ipc", root)
end

# The endpoint the supervisor will bind to.
# @returns [::IO::Endpoint::Generic]
def endpoint
::IO::Endpoint.unix(ipc_path)
end

# Options to use when creating the container.
def container_options
{restart: true, count: 1, health_check_timeout: 30}
end
end

LEGACY_ENVIRONMENTS[:supervisor] = Supervisor
Expand Down
4 changes: 2 additions & 2 deletions lib/falcon/service/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
require "process/metrics"
require "json"

require "async/service/generic"
require "async/container/supervisor/service"

require "io/endpoint/bound_endpoint"
require "io/stream"

module Falcon
module Service
# Implements a host supervisor which can restart the host services and provide various metrics about the running processes.
class Supervisor < Async::Service::Generic
class Supervisor < Async::Container::Supervisor::Service
# Initialize the supervisor using the given environment.
# @parameter environment [Build::Environment]
def initialize(...)
Expand Down

0 comments on commit 2d4b05e

Please sign in to comment.