Server

sealed trait Server[-R, +E]
Companion:
object
class Object
trait Matchable
class Any
Server[R, E]

Value members

Concrete methods

def ++[R1 <: R, E1 >: E](other: Server[R1, E1]): Server[R1, E1]
def make(implicit ev: E <:< Throwable): ZIO[R & EventLoopGroup & ServerChannelFactory & Scope, Throwable, Start]
def start(implicit ev: E <:< Throwable): ZIO[R & EventLoopGroup & ServerChannelFactory, Throwable, Nothing]
def startDefault[R1 <: R](implicit ev: E <:< Throwable): ZIO[R1, Throwable, Nothing]

Launches the app with current settings: default EventLoopGroup (nThreads = 0) and ServerChannelFactory.auto.

Launches the app with current settings: default EventLoopGroup (nThreads = 0) and ServerChannelFactory.auto.

def withAcceptContinue(enable: Boolean): Server[R, E]

Creates a new server using a HttpServerExpectContinueHandler to send a 100 HttpResponse if necessary.

Creates a new server using a HttpServerExpectContinueHandler to send a 100 HttpResponse if necessary.

def withBinding(hostname: String, port: Int): Server[R, E]

Creates a new server listening on the provided hostname and port.

Creates a new server listening on the provided hostname and port.

def withBinding(address: InetAddress, port: Int): Server[R, E]

Creates a new server listening on the provided InetAddress and port.

Creates a new server listening on the provided InetAddress and port.

def withBinding(inetSocketAddress: InetSocketAddress): Server[R, E]

Creates a new server listening on the provided InetSocketAddress.

Creates a new server listening on the provided InetSocketAddress.

def withConsolidateFlush(enable: Boolean): Server[R, E]

Creates a new server with FlushConsolidationHandler to control the flush operations in a more efficient way if enabled (@see FlushConsolidationHandler).

def withError[R1](errorHandler: Throwable => ZIO[R1, Nothing, Unit]): Server[R & R1, E]

Creates a new server with the errorHandler provided.

Creates a new server with the errorHandler provided.

def withFlowControl(enable: Boolean): Server[R, E]

Creates a new server using netty FlowControlHandler if enable (@see FlowControlHandler).

Creates a new server using netty FlowControlHandler if enable (@see FlowControlHandler).

def withKeepAlive(enable: Boolean): Server[R, E]

Creates a new server with netty's HttpServerKeepAliveHandler to close persistent connections when enable is true (@see HttpServerKeepAliveHandler).

Creates a new server with netty's HttpServerKeepAliveHandler to close persistent connections when enable is true (@see HttpServerKeepAliveHandler).

Creates a new server with the leak detection level provided (@see ResourceLeakDetector.Level).

Creates a new server with the leak detection level provided (@see ResourceLeakDetector.Level).

def withObjectAggregator(maxRequestSize: Int): Server[R, E]

Creates a new server with HttpObjectAggregator with the specified max size of the aggregated content.

Creates a new server with HttpObjectAggregator with the specified max size of the aggregated content.

def withPort(port: Int): Server[R, E]

Creates a new server listening on the provided port.

Creates a new server listening on the provided port.

def withRequestDecompression(enabled: Boolean, strict: Boolean): Server[R, E]

Creates a new server with netty's HttpContentDecompressor to decompress Http requests (@see HttpContentDecompressor).

Creates a new server with netty's HttpContentDecompressor to decompress Http requests (@see HttpContentDecompressor).

def withSsl(sslOptions: ServerSSLOptions): Server[R, E]

Creates a new server with the following ssl options.

Creates a new server with the following ssl options.

def withUnsafeChannelPipeline(unsafePipeline: ChannelPipeline => Unit): Server[R, E]

Creates a new server by passing a function that modifies the channel pipeline. This is generally not required as most of the features are directly supported, however think of this as an escape hatch for more advanced configurations that are not yet support by ZIO Http.

Creates a new server by passing a function that modifies the channel pipeline. This is generally not required as most of the features are directly supported, however think of this as an escape hatch for more advanced configurations that are not yet support by ZIO Http.

NOTE: This method might be dropped in the future.

def withUnsafeServerBootstrap(unsafeServerbootstrap: ServerBootstrap => Unit): Server[R, E]

Provides unsafe access to netty's ServerBootstrap. Modifying server bootstrap is generally not advised unless you know what you are doing.

Provides unsafe access to netty's ServerBootstrap. Modifying server bootstrap is generally not advised unless you know what you are doing.