Table of Contents

Class StallClock

One backoff clock for a bulk activity that keeps no per-tile state (parent prefetch, region walk).

public sealed class StallClock
Inheritance
object
StallClock

Remarks

Bounds the aggregate request rate without touching any tile's retry budget. Permanent errors do not stall other tiles. A run of successes steps the streak back; a single success does not zero it.

Properties

FailStreak

Consecutive-failure depth, for diagnostics.

public int FailStreak { get; }

Property Value

int

Methods

IsStalled(double)

True while the whole activity is held off.

public bool IsStalled(double now)

Parameters

now double

Current time in seconds.

Returns

bool

True when now is still before the stall instant.

NoteFailure(TileFetchError, double)

Records a failed request against the shared clock. Permanent errors are ignored so one not-found cannot stall the rest of the job.

public void NoteFailure(TileFetchError error, double now)

Parameters

error TileFetchError

Classified fetch outcome.

now double

Current time in seconds.

NoteSuccess()

Records a successful request. Four successes in a row step the stall streak down by one; a single success does not clear it.

public void NoteSuccess()

Reset()

Clears the stall, for a deliberately started new job.

public void Reset()

SecondsRemaining(double)

Seconds until the activity resumes; 0 when running.

public double SecondsRemaining(double now)

Parameters

now double

Current time in seconds.

Returns

double

Remaining stall in seconds, or 0 if the clock is running.