Struct WeightedSerialParQueueHandle
pub struct WeightedSerialParQueueHandle { /* private fields */ }Expand description
同一权重队列(weighted queue)的提交、取出和数量查询权限。
释放本句柄(handle)只归还访问权。管理者停收后,所有副本均拒绝新提交。
Implementations§
§impl WeightedSerialParQueueHandle
impl WeightedSerialParQueueHandle
pub fn try_push_parallel(
&self,
task: Runnable,
weight: TaskWeight,
) -> Result<(), ExternalPushError>
pub fn try_push_parallel( &self, task: Runnable, weight: TaskWeight, ) -> Result<(), ExternalPushError>
尝试按指定并行权重(weight)接收原可执行句柄(Runnable)。
明确拒绝时返还同一原值。成功表示已移交给队列,任务仍待其执行器接纳。
Trait Implementations§
§impl Clone for WeightedSerialParQueueHandle
impl Clone for WeightedSerialParQueueHandle
§impl ExternalTaskQueue for WeightedSerialParQueueHandle
impl ExternalTaskQueue for WeightedSerialParQueueHandle
§fn try_push(&self, task: Runnable) -> Result<(), ExternalPushError>
fn try_push(&self, task: Runnable) -> Result<(), ExternalPushError>
尝试接管一份Runnable;拒绝时返还原值,不能执行后再拒绝。
§fn try_take_batch(&self) -> BatchAttempt
fn try_take_batch(&self) -> BatchAttempt
一次尝试获取当前有序批次。已取得的非空前缀以
Ready交付。
若尚有在途的来源责任且本次没有可交付的任务,可返回WouldBlock。
不循环等待未来提交来填满批次。Auto Trait Implementations§
impl !RefUnwindSafe for WeightedSerialParQueueHandle
impl !UnwindSafe for WeightedSerialParQueueHandle
impl Forget for WeightedSerialParQueueHandle
impl Freeze for WeightedSerialParQueueHandle
impl Move for WeightedSerialParQueueHandle
impl Send for WeightedSerialParQueueHandle
impl Sync for WeightedSerialParQueueHandle
impl Unpin for WeightedSerialParQueueHandle
impl UnsafeUnpin for WeightedSerialParQueueHandle
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