Class: Pytty::Client::Cli::SignalCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/pytty/client/cli/signal_command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pytty/client/cli/signal_command.rb', line 14

def execute
  Async.run do
    internet = Async::HTTP::Internet.new
    headers = [['accept', 'application/json']]
    body = {}.to_json

    for id in id_list do
      #TODO /v1/process/:id/signal ?
      response = internet.post("http://localhost:1234/v1/signal/#{signal}/#{id}", headers, [body])
      p response.read
    end
  ensure
    internet.close
  end
end