ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Metadata.EntryFloor

Description

The least a full JSON listing read pays for each entry it retains. Per-byte charges are calibrated on realistic listings, so a document of many tiny entries would retain more than its bytes pay for. Such a read raises its workspace charge to the floor after each piece it walks, and keeps the floor once it completes.

Synopsis

Documentation

entryFloorBytes :: Int Source #

The bytes each retained entry other than a version or file costs at least. A residency case measures dense listings to set it: see docs/testing.md.

releaseFloorBytes :: Int Source #

The bytes each retained npm version or PyPI file costs at least, which the residency tier measures on minimal valid bodies.

data RetainedEntries Source #

The entries a full read retains, by the floor each pays.

Constructors

RetainedEntries 

Fields

noRetainedEntries :: RetainedEntries Source #

No retained entries: a read with no floor, or a document no read produced.

entryFloorCharge :: RetainedEntries -> Int Source #

The floors the retained entries owe, saturating at the largest charge. Each step of a walk computes it, so it stays in Int.

countingEntries :: PrimVar st Int -> (s -> RetainedEntries) -> (Either LimitError s -> ST st r) -> Either LimitError s -> ST st r Source #

Continue a step after publishing the floors its accepted state's retained entries owe.

readFlooredWalk :: (Int -> IO ()) -> Int -> BodyLimit -> (PrimVar RealWorld Int -> Cursor -> ST RealWorld (Steps (ST RealWorld) s)) -> IO ByteString -> IO (Either LimitError (StreamResult s)) Source #

Walk a body, raising pay's absolute workspace before each piece to the floors the walk has published, less the per-byte charge at permille the pieces read so far already paid.