package shuttle_http
Module Server.ConfigSource
Source
val create :
?buf_len:int ->
?max_connections:int ->
?max_accepts_per_batch:int ->
?backlog:int ->
?write_timeout:Core.Time_ns.Span.t ->
?read_header_timeout:Core.Time_ns.Span.t ->
?error_handler:error_handler ->
unit ->
tHTTP Server configuration
buf_lenis the buffer size used for the underlying tcp socket channel. The default value is 16_000 bytes.
max_connectionsis the maximum number of concurrent connections that can be active within a server. The default behavior is to have no upper bound on this number.
max_accepts_per_batchis the maximum number of socket connections that a server will attempt to accept in a single accept call. The default value is 1.
backlogis the number of clients that can have a pending connection. Additional connections can be rejected, enqueued or ignored based on the underlying operating system's behavior.
write_timeoutis the maximum duration that the underlying socket will wait for any pending write syscalls to finish.
read_header_timeoutis the maximum time span that the server loop is allowed to read a request's headers. The default value is 60 seconds. If read_header_timeout is zero then no timeout is used, and the server could potentially wait forever attempting to read enough data to parse request headers.
error_handlerallows customizing how unhandled exceptions, and any potential parsing or i/o errors get rendered. The default implementation will attempt to send an HTTP response with a status code and an empty body.