RetrievalLanes

Shared, key-agnostic retrieval-lane bookkeeping. Used by every poll-per-frame retriever that has a local cache in front of a remote source — the image earth.worldwind.render.RenderResourceCache (keyed by ImageSource) and the gridded-coverage earth.worldwind.globe.elevation.coverage.AbstractTiledElevationCoverage (keyed by tile Long).

Splits retrievals into a remote lane (anything fetched from a remote server) and a local lane (in-bundle resources, local files, and cache-only reads), so a slow remote fetch can never occupy a slot a local or cached read needs. The piece that makes the separation actually hold is cacheChecked: once a source's cache-only read misses, it is recorded so its cache read is NOT re-issued on every subsequent frame while it waits for a remote slot. Without that, a congested remote lane indirectly saturates the local lane with repeating cache-miss reads and starves genuine local resources.

The element type K is the retrieval's identity key (an ImageSource, a tile Long, …); it must have value-correct equals/hashCode since membership drives dedup and the lane budgets.

Not thread-safe: callers reserve/release from a single retrieval scope (the main scope on every platform), matching how the elevation and image stacks already drive retrieval.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Keys whose cache-only read already missed: route straight to the remote lane instead of re-reading the cache every frame. Cleared on success / failure / revalidation / clear.

Link copied to clipboard

Local reads in progress (local lane): resources, files, and cache-only reads.

Link copied to clipboard

Remote-server fetches in progress (remote lane).

Functions

Link copied to clipboard
fun canReserve(lane: RetrievalLane, queueSize: Int, key: K): Boolean

True when key can be reserved on lane now: a free slot and not already in flight there.

Link copied to clipboard
fun clear()
Link copied to clipboard

True when a remote (network) fetch for key is already in flight.

Link copied to clipboard
fun markChecked(key: K)
Link copied to clipboard

Plan the next phase for a cache-backed key:

Link copied to clipboard
fun release(lane: RetrievalLane, key: K)
Link copied to clipboard
fun reserve(lane: RetrievalLane, key: K)
Link copied to clipboard
fun unmarkChecked(key: K)