pub struct SyncLoop { /* private fields */ }Expand description
Control of one serialized pass loop. Commands survive caller cancellation.
It publishes its activity to the owner’s SequenceState.
Implementations§
Source§impl SyncLoop
impl SyncLoop
Sourcepub fn new(sync: Arc<SequenceSync>, codes: RestoreCodes) -> Self
pub fn new(sync: Arc<SequenceSync>, codes: RestoreCodes) -> Self
Compose a stopped loop for an open, connected sequence owner.
codes completes member-key replacement and installs delivered S3 keys
on this device after each pass (§11.5, §14.3).
A panic in the loop goes to the store’s bug sink, and ends the loop
as a failure: the last pass is recorded failed with the bug, sync
stops, and the retries waiting, those the panicking pass took among
them, are answered with it as SyncError::WorkerFailed (E15).
Sourcepub fn parked_from_now(&self) -> impl Future<Output = ()> + Send + 'static
pub fn parked_from_now(&self) -> impl Future<Output = ()> + Send + 'static
Each time the loop has taken every command, change and wake that was ready, and waits for the next.
Sourcepub fn pause_asked_from_now(&self) -> impl Future<Output = ()> + Send + 'static
pub fn pause_asked_from_now(&self) -> impl Future<Output = ()> + Send + 'static
Wait until a pause is asked of the loop after this call; the pause then waits for the loop to take it, after any pass under way.
Sourcepub async fn start(&self) -> Result<(), SyncError>
pub async fn start(&self) -> Result<(), SyncError>
Start and request an immediate pass. From now on the person’s retry requests wait for this loop’s passes.
Sourcepub fn sync_now(&self) -> Result<(), SyncError>
pub fn sync_now(&self) -> Result<(), SyncError>
Retain one pass request, including while a pass is running.
Sourcepub async fn stop(&self) -> Result<(), SyncError>
pub async fn stop(&self) -> Result<(), SyncError>
Queue stopping after the active pass and this connection’s transfers.
Stopping writes nothing the sync state reads; a release failure is
recorded as the last pass’s failure.
Retry requests no pass has taken are answered NotSyncing now. The
loop stops even when writing that fails, and the call returns why.
Sourcepub async fn pause(&self) -> Result<(), SyncError>
pub async fn pause(&self) -> Result<(), SyncError>
Wait for the active pass, retaining its started state, pending work and retry schedule while the owner prepares a connection or custody change.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SyncLoop
impl !UnwindSafe for SyncLoop
impl Freeze for SyncLoop
impl Send for SyncLoop
impl Sync for SyncLoop
impl Unpin for SyncLoop
impl UnsafeUnpin for SyncLoop
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
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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