class Falcon::Service::Server

def setup(container)

@parameter container [Async::Container::Generic]
Setup the container with the application instance.
def setup(container)
	container_options = @evaluator.container_options
	health_check_timeout = container_options[:health_check_timeout]
	
	container.run(name: self.name, **container_options) do |instance|
		evaluator = @environment.evaluator
		
		Async do |task|
			server = Falcon::Server.new(evaluator.middleware, @bound_endpoint, protocol: @endpoint.protocol, scheme: @endpoint.scheme)
			
			server.run
			
			instance.ready!
			
			if health_check_timeout
				Async(transient: true) do
					while true
						# We only update this if the health check is enabled. Maybe we should always update it?
						instance.name = "#{self.name} (#{server.statistics_string} L=#{Fiber.scheduler.load.round(3)})"
						sleep(health_check_timeout / 2)
						instance.ready!
					end
				end
			end
			
			task.children.each(&:wait)
		end
	end
end