# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2026, by Samuel Williams.

require_relative "../service/server"

module Async
	module HTTY
		module Environment
			# An async-service environment module for HTTY transport.
			# Include this (or let Lively::Environment::Application include it)
			# to replace Falcon with an HTTY server in the service lifecycle.
			module Server
				# Do not restart after the HTTY session ends.
				# Unlike a TCP server, there is nothing to reconnect to once
				# stdin/stdout closes.
				# @returns [Hash]
				def container_options
					{count: 1, restart: false}
				end
				
				# Use the HTTY service server instead of Falcon's.
				# @returns [Class]
				def service_class
					Async::HTTY::Service::Server
				end
			end
		end
	end
end
