Struct WeightedSerialParQueue
pub struct WeightedSerialParQueue { /* private fields */ }Expand description
支持串行和加权并行选择的外部任务队列(external task queue)。
管理者只能按值绑定给一个独立执行器(executor)。共享句柄(shared handle) 可以跨线程提交。同一串行队列(serial queue)中,普通取出已交付的前项 要先析构(drop)原异步计算(Future),才能再取后项。结果句柄(result handle)可继续保留。
clear 每次清理有限数量,可能取到调用开始后接收的任务。清理与普通取出
可能等待当次遇到的原生发布及重试。清理取出的任务会先释放原生句柄,再析构任务。
显式 close 永久停收。清理完成后
返回错误,原因是上游原生池分配会存续到进程退出。
Implementations§
Source§impl WeightedSerialParQueue
impl WeightedSerialParQueue
Sourcepub fn new() -> WeightedSerialParQueue
pub fn new() -> WeightedSerialParQueue
创建空队列。每次构造会保留一份原生池分配至进程退出。
上游分配失败沿用全局分配器(global allocator)的行为。
Trait Implementations§
Source§impl Default for WeightedSerialParQueue
impl Default for WeightedSerialParQueue
Source§fn default() -> WeightedSerialParQueue
fn default() -> WeightedSerialParQueue
Returns the “default value” for a type. Read more
Source§impl Drop for WeightedSerialParQueue
impl Drop for WeightedSerialParQueue
Source§impl ExternalQueueManager for WeightedSerialParQueue
impl ExternalQueueManager for WeightedSerialParQueue
Source§fn close(&mut self) -> Result<QueueCleanupProgress, Report<ErrorKind>>
fn close(&mut self) -> Result<QueueCleanupProgress, Report<ErrorKind>>
永久停收并推进有限清理。尚有清理责任时返回 Busy,完成后返回说明
原生池分配保留到进程退出的 Unsupported。
Source§type Handle = WeightedSerialParQueueHandle
type Handle = WeightedSerialParQueueHandle
同一原来源的普通共享访问;不是另一队列(queue)或另一份计数。
Source§fn handle(&self) -> <WeightedSerialParQueue as ExternalQueueManager>::Handle
fn handle(&self) -> <WeightedSerialParQueue as ExternalQueueManager>::Handle
取得同一来源的受限共享句柄(shared handle),不重置已关闭状态(state)。
Auto Trait Implementations§
impl !RefUnwindSafe for WeightedSerialParQueue
impl !UnwindSafe for WeightedSerialParQueue
impl Forget for WeightedSerialParQueue
impl Freeze for WeightedSerialParQueue
impl Move for WeightedSerialParQueue
impl Send for WeightedSerialParQueue
impl Sync for WeightedSerialParQueue
impl Unpin for WeightedSerialParQueue
impl UnsafeUnpin for WeightedSerialParQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more