Struct ntex::server::ServerBuilder[][src]

pub struct ServerBuilder { /* fields omitted */ }
Expand description

Server builder

Implementations

Create new Server builder instance

Set number of workers to start.

By default server uses number of available logical cpu as workers count.

Set the maximum number of pending connections.

This refers to the number of clients that can be waiting to be served. Exceeding this number results in the client getting an error when attempting to connect. It should only affect servers under significant load.

Generally set in the 64-2048 range. Default value is 2048.

This method should be called before bind() method call.

Sets the maximum per-worker number of concurrent connections.

All socket listeners will stop accepting connections when this limit is reached for each worker.

By default max connections is set to a 25k per worker.

Stop ntex runtime when server get dropped.

By default “stop runtime” is disabled.

Disable signal handling.

By default signal handling is enabled.

Timeout for graceful workers shutdown.

After receiving a stop signal, workers have this much time to finish serving requests. Workers still alive after the timeout are force dropped.

By default shutdown timeout sets to 30 seconds.

Set server status handler.

Server calls this handler on every inner status update.

Execute external configuration as part of the server building process.

This function is useful for moving parts of configuration to a different module or even library.

Register async service configuration function.

This function get called during worker runtime configuration stage. It get executed in the worker thread.

Add new service to the server.

Add new unix domain service to the server.

Add new unix domain service to the server. Useful when running as a systemd service and a socket FD can be acquired using the systemd crate.

Add new service to the server.

Starts processing incoming connections and return server controller.

Trait Implementations

Returns the “default value” for a type. Read more

The type of value produced on completion.

Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Map this future’s output to a different type, returning a new future of the resulting type. Read more

Map this future’s output to a different type, returning a new future of the resulting type. Read more

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more

Wrap this future in an Either future, making it the left-hand variant of that Either. Read more

Wrap this future in an Either future, making it the right-hand variant of that Either. Read more

Convert this future into a single element stream. Read more

Flatten the execution of this future when the output of this future is itself another future. Read more

Flatten the execution of this future when the successful result of this future is a stream. Read more

Fuse a future such that poll will never again be called once it has completed. This method can be used to turn any Future into a FusedFuture. Read more

Do something with the output of a future before passing it on. Read more

Catches unwinding panics while polling the future. Read more

Create a cloneable handle to this future where all handles will resolve to the same result. Read more

Wrap the future in a Box, pinning it. Read more

Wrap the future in a Box, pinning it. Read more

A convenience for calling Future::poll on Unpin future types.

Evaluates and consumes the future, returning the resulting output if the future is ready after the first call to Future::poll. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

🔬 This is a nightly-only experimental API. (into_future)

Creates a future from a value.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more