Skip to content

Commit

Permalink
Remove usage of async/io from Falcon::Command::Supervisor.
Browse files Browse the repository at this point in the history
- This code seems untested.
  • Loading branch information
ioquatix committed Apr 24, 2024
1 parent d34bfa3 commit 5571f4e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/falcon/command/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
require 'async'
require 'json'

require 'async/io/stream'
require 'async/io/unix_endpoint'
require 'io/endpoint/unix_endpoint'
require 'io/stream'

module Falcon
module Command
Expand Down Expand Up @@ -43,7 +43,7 @@ def call(stream)
stream.puts({please: 'metrics'}.to_json, separator: "\0")
response = JSON.parse(stream.gets("\0"), symbolize_names: true)

pp response
$stdout.puts response
end
end

Expand All @@ -57,16 +57,14 @@ def call(stream)

# The endpoint the supervisor is bound to.
def endpoint
Async::IO::Endpoint.unix(@options[:path])
::IO::Endpoint.unix(@options[:path])
end

# Connect to the supervisor and execute the requested command.
def call
Async do
Sync do
endpoint.connect do |socket|
stream = Async::IO::Stream.new(socket)

@command.call(stream)
@command.call(IO::Stream(socket))
end
end
end
Expand Down

0 comments on commit 5571f4e

Please sign in to comment.