Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

Builder struct for a ntex runtime.

Either use Builder::build to create a system and start actors. Alternatively, use Builder::run to start the tokio runtime and run a function in its context.

Implementations§

Source§

impl Builder

Source

pub fn name<N: AsRef<str>>(self, name: N) -> Self

Sets the name of the System.

Source

pub fn stop_on_panic(self, stop_on_panic: bool) -> Self

Sets the option ‘stop_on_panic’ which controls whether the System is stopped when an uncaught panic is thrown from a worker thread.

Defaults to false.

Source

pub fn stack_size(self, size: usize) -> Self

Sets the size of the stack (in bytes) for the new thread.

Source

pub fn ping_interval(self, interval: usize) -> Self

Sets ping interval for spawned arbiters.

Interval is in milliseconds. By default 5000 milliseconds is set. To disable pings set value to zero.

Source

pub fn thread_pool_limit(self, value: usize) -> Self

Set the thread number limit of the inner thread pool, if exists. The default value is 256.

Source

pub fn thread_pool_recv_timeout<T>(self, timeout: T) -> Self
where Duration: From<T>,

Set the waiting timeout of the inner thread, if exists. The default is 60 seconds.

Source

pub fn build<R: Runner>(self, runner: R) -> SystemRunner

Create new System.

This method panics if it can not create tokio runtime

Source

pub fn build_with(self, config: SystemConfig) -> SystemRunner

Create new System.

This method panics if it can not create tokio runtime

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.