class Falcon::Service::Supervisor
def setup(container)
Start the supervisor process which accepts connections from the bound endpoint and processes JSON formatted messages.
def setup(container) container.run(name: self.name, restart: true, count: 1) do |instance| Async do @bound_endpoint.accept do |peer| stream = ::IO::Stream(peer) while message = stream.read_until("\0") response = handle(JSON.parse(message, symbolize_names: true)) stream.puts(response.to_json, separator: "\0") end end instance.ready! end end super end