pub struct GCJobManager { /* private fields */ }Expand description
Job manager for tracking pending GC requests.
Implementations§
Source§impl GCJobManager
impl GCJobManager
Sourcepub fn with_timeout(default_timeout: Duration) -> Self
pub fn with_timeout(default_timeout: Duration) -> Self
Create a new GC job manager with a custom default timeout.
Sourcepub fn create_job(
&self,
appid: u32,
response_msg_type: u32,
) -> Receiver<GCJobResponse>
pub fn create_job( &self, appid: u32, response_msg_type: u32, ) -> Receiver<GCJobResponse>
Create a new job and return the response receiver.
The job is keyed by (appid, response_msg_type). When a GC message
matching this key arrives, the job will be completed.
Sourcepub fn create_job_with_timeout(
&self,
appid: u32,
response_msg_type: u32,
timeout: Duration,
) -> Receiver<GCJobResponse>
pub fn create_job_with_timeout( &self, appid: u32, response_msg_type: u32, timeout: Duration, ) -> Receiver<GCJobResponse>
Create a new job with a custom timeout.
Sourcepub fn try_complete(&self, appid: u32, msg_type: u32, payload: Vec<u8>) -> bool
pub fn try_complete(&self, appid: u32, msg_type: u32, payload: Vec<u8>) -> bool
Try to complete a job with a GC message.
Returns true if a matching job was found and completed.
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
Clean up expired jobs.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get the number of pending jobs.
Trait Implementations§
Source§impl Clone for GCJobManager
impl Clone for GCJobManager
Source§fn clone(&self) -> GCJobManager
fn clone(&self) -> GCJobManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GCJobManager
impl RefUnwindSafe for GCJobManager
impl Send for GCJobManager
impl Sync for GCJobManager
impl Unpin for GCJobManager
impl UnsafeUnpin for GCJobManager
impl UnwindSafe for GCJobManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more