diff --git a/lib/falcon/command/supervisor.rb b/lib/falcon/command/supervisor.rb index 1b5686c..bfbfd47 100644 --- a/lib/falcon/command/supervisor.rb +++ b/lib/falcon/command/supervisor.rb @@ -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 @@ -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 @@ -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