Struct WeightedSerialParQueue
pub struct WeightedSerialParQueue { /* private fields */ }Expand description
支持串行和加权并行选择的外部任务队列(external task queue)。
管理者只能按值绑定给一个独立执行器(executor)。共享句柄(shared handle) 可以跨线程提交。同一串行队列(serial queue)中,普通取出已交付的前项 要先析构(drop)原异步计算(Future),才能再取后项。结果句柄(result handle)可继续保留。
clear 每次清理有限数量,可能取到调用开始后接收的任务。清理与普通取出
可能等待当次遇到的原生发布及重试。清理取出的任务会先释放原生句柄,再析构任务。
显式 close 永久停收。清理完成后
返回错误,原因是上游原生池分配会存续到进程退出。
Implementations§
§impl WeightedSerialParQueue
impl WeightedSerialParQueue
pub fn new() -> Self
pub fn new() -> Self
创建空队列。每次构造会保留一份原生池分配至进程退出。
上游分配失败沿用全局分配器(global allocator)的行为。
Trait Implementations§
§impl Default for WeightedSerialParQueue
impl Default for WeightedSerialParQueue
§impl Drop for WeightedSerialParQueue
impl Drop for WeightedSerialParQueue
§impl ExternalQueueManager for WeightedSerialParQueue
impl ExternalQueueManager for WeightedSerialParQueue
§fn close(&mut self) -> Result<QueueCleanupProgress>
fn close(&mut self) -> Result<QueueCleanupProgress>
永久停收并推进有限清理。尚有清理责任时返回 Busy,完成后返回说明
原生池分配保留到进程退出的 Unsupported。
§type Handle = WeightedSerialParQueueHandle
type Handle = WeightedSerialParQueueHandle
同一原来源的普通共享访问;不是另一队列(queue)或另一份计数。
§fn clear(&mut self) -> Result<QueueCleanupProgress>
fn clear(&mut self) -> Result<QueueCleanupProgress>
有限清理本次固定范围,接收仍保持原状,不轮询(poll)业务。 Read more
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