| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- entryFloorBytes :: Int
- releaseFloorBytes :: Int
- data RetainedEntries = RetainedEntries {}
- noRetainedEntries :: RetainedEntries
- entryFloorCharge :: RetainedEntries -> Int
- countingEntries :: PrimVar st Int -> (s -> RetainedEntries) -> (Either LimitError s -> ST st r) -> Either LimitError s -> ST st r
- readFlooredWalk :: (Int -> IO ()) -> Int -> BodyLimit -> (PrimVar RealWorld Int -> Cursor -> ST RealWorld (Steps (ST RealWorld) s)) -> IO ByteString -> IO (Either LimitError (StreamResult s))
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
| |
Instances
| Show RetainedEntries Source # | |
Defined in Ecluse.Core.Registry.Metadata.EntryFloor Methods showsPrec :: Int -> RetainedEntries -> ShowS # show :: RetainedEntries -> String # showList :: [RetainedEntries] -> ShowS # | |
| Eq RetainedEntries Source # | |
Defined in Ecluse.Core.Registry.Metadata.EntryFloor Methods (==) :: RetainedEntries -> RetainedEntries -> Bool # (/=) :: RetainedEntries -> RetainedEntries -> Bool # | |
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.