MultiTaskRuntimeBuilder

Struct MultiTaskRuntimeBuilder 

Source
pub struct MultiTaskRuntimeBuilder<O: Default + 'static = (), P: AsyncTaskPoolExt<O> + AsyncTaskPool<O> = StealableTaskPool<O>> { /* private fields */ }
Expand description

异步多线程任务运行时构建器

Implementations§

Source§

impl<O: Default + 'static, P: AsyncTaskPoolExt<O> + AsyncTaskPool<O, Pool = P>> MultiTaskRuntimeBuilder<O, P>

Source

pub fn new(pool: P) -> Self

构建指定任务池、线程名前缀、初始线程数量、最少线程数量、最大线程数量、线程栈大小、线程空闲时最长休眠时间和是否使用本地定时器的多线程任务池

Source

pub fn thread_prefix(self, prefix: &str) -> Self

设置工作者线程名称前缀

Source

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

设置工作者线程栈大小

Source

pub fn init_worker_size(self, init: usize) -> Self

设置初始工作者数量

Source

pub fn set_worker_limit(self, min: usize, max: usize) -> Self

设置最小工作者数量和最大工作者数量

Source

pub fn set_timeout(self, timeout: u64) -> Self

设置工作者空闲时最大休眠时长

Source

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

设置工作者定时器间隔

Source

pub fn build(self) -> MultiTaskRuntime<O, P>

构建并启动多线程异步运行时

Trait Implementations§

Source§

impl<O: Default + 'static> Default for MultiTaskRuntimeBuilder<O>

Source§

fn default() -> Self

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

impl<O: Default + 'static, P: AsyncTaskPoolExt<O> + AsyncTaskPool<O>> Send for MultiTaskRuntimeBuilder<O, P>

Source§

impl<O: Default + 'static, P: AsyncTaskPoolExt<O> + AsyncTaskPool<O>> Sync for MultiTaskRuntimeBuilder<O, P>

Auto Trait Implementations§

§

impl<O, P> Freeze for MultiTaskRuntimeBuilder<O, P>
where P: Freeze,

§

impl<O, P> RefUnwindSafe for MultiTaskRuntimeBuilder<O, P>

§

impl<O, P> Unpin for MultiTaskRuntimeBuilder<O, P>
where P: Unpin, O: Unpin,

§

impl<O, P> UnwindSafe for MultiTaskRuntimeBuilder<O, P>
where P: UnwindSafe, O: UnwindSafe,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ThreadSend for T
where T: Send,

Source§

impl<T> ThreadSync for T
where T: Sync + Send,