pub struct GcQueue(/* private fields */);Expand description
The queue: one worker, one job at a time, FIFO, deduplicated by repository.
A named type over JobQueue<Gc> rather than an alias, so Repos.Gc’s
door keeps speaking in repositories — enqueue("acct/repo") — instead of
making every caller build an order to say one string.
Implementations§
Source§impl GcQueue
impl GcQueue
Sourcepub fn new(run: GcRunner) -> Self
pub fn new(run: GcRunner) -> Self
A queue over run. No thread is started until something is enqueued.
Sourcepub fn enqueue(&self, path: &str) -> GcJob
pub fn enqueue(&self, path: &str) -> GcJob
Ask for path to be maintained, and return without maintaining it.
Returns the job that is now responsible for the repository: a new one, or the one that was already queued or running. Never enqueues a second job for a repository that has one live.
Sourcepub fn status(&self, path: &str) -> Option<GcJob>
pub fn status(&self, path: &str) -> Option<GcJob>
The job the queue is holding for path, if it still has one.
Sourcepub fn peak_in_flight(&self) -> usize
pub fn peak_in_flight(&self) -> usize
The highest number of gcs that have ever been running together.
Must be 1 after any amount of traffic — that is the invariant this module exists for, and this is how a test sees it rather than infers it. 0 before anything has run.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GcQueue
impl !UnwindSafe for GcQueue
impl Freeze for GcQueue
impl Send for GcQueue
impl Sync for GcQueue
impl Unpin for GcQueue
impl UnsafeUnpin for GcQueue
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request