ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Cve.Slot

Description

Advisory generations stay pinned for each lookup. Retirement belongs to the last reader, or to the swapper when no readers remain, even if the swapper is cancelled.

Synopsis

Documentation

data CveSlot Source #

The slot: the currently-active generation, or nothing before the first sync.

newCveSlot :: IO CveSlot Source #

A fresh, empty slot: readers see Nothing until the first swapIn.

withSlotGeneration :: CveSlot -> (Maybe (DbEtag, CveLookup, AdvisorySource) -> IO a) -> IO a Source #

Borrow a generation's lookup, ETag and publication metadata until the action returns or is cancelled.

currentAdvisoryEtag :: CveSlot -> IO (Maybe DbEtag) Source #

Read the active ETag without pinning, or Nothing before the first sync.

data AdvisorySource Source #

The store's publication metadata. Republishing identical bytes can advance the timestamp.

Constructors

AdvisorySource 

Fields

Instances

Instances details
Show AdvisorySource Source # 
Instance details

Defined in Ecluse.Core.Cve.Slot

Eq AdvisorySource Source # 
Instance details

Defined in Ecluse.Core.Cve.Slot

currentAdvisorySource :: CveSlot -> IO (Maybe AdvisorySource) Source #

Read the active publication metadata, retained across failed polls, or Nothing before the first sync.

observeAdvisoryPublication :: CveSlot -> DbEtag -> Maybe UTCTime -> IO () Source #

Advance publication time only for the installed ETag, without replacing or retiring its database.

generationInstalledAt :: CveSlot -> IO (Maybe Double) Source #

Read when swapIn installed the active generation, separately from its publication time.

swapIn :: CveSlot -> DbEtag -> Maybe UTCTime -> CveDb -> IO () Source #

Take ownership of the verified database, install it, then close the displaced database after its readers drain.