| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Cache
Description
One provider owns metadata retention. Local single-flight shares active requests. Public metadata and content-addressed responses follow the sharing policy in the web-layer architecture.
Synopsis
- data CacheConfig = CacheConfig {}
- data StoreBudget = StoreBudget {
- sbMinEntries :: Int
- sbMinBytes :: Int
- data MetadataCache
- newMetadataCache :: CacheConfig -> IO MetadataCache
- newMetadataCacheWithProvider :: CacheProvider -> IO MetadataCache
- newtype Source = Source Text
- data CacheEntry = CacheEntry {}
- resolveMetadata :: MetricsPort -> MetadataCache -> Source -> PackageName -> IO (Either MetadataError CacheEntry) -> IO (Either MetadataError CacheEntry)
- metadataKey :: Source -> PackageName -> Text
- resolveVersion :: MetricsPort -> MetadataCache -> Source -> PackageName -> Version -> IO (Either MetadataError VersionRead) -> IO (Either MetadataError VersionRead)
- prepareVersion :: MetricsPort -> MetadataCache -> Source -> PackageName -> Version -> IO (Either MetadataError VersionRead) -> IO (PreparedStore MetadataError VersionRead)
- resolveAssembled :: MetricsPort -> MetadataCache -> Text -> IO ByteString -> IO ByteString
Configuration
data CacheConfig Source #
Retention bounds and the TTL for the local selected-version and assembled stores.
Constructors
| CacheConfig | |
Fields
| |
Instances
| Show CacheConfig Source # | |
Defined in Ecluse.Core.Server.Cache.Types Methods showsPrec :: Int -> CacheConfig -> ShowS # show :: CacheConfig -> String # showList :: [CacheConfig] -> ShowS # | |
| Eq CacheConfig Source # | |
Defined in Ecluse.Core.Server.Cache.Types | |
data StoreBudget Source #
Retention floors, used only to stop a store evicting its own live entries.
Constructors
| StoreBudget | |
Fields
| |
Instances
| Show StoreBudget Source # | |
Defined in Ecluse.Core.Server.Cache.Types Methods showsPrec :: Int -> StoreBudget -> ShowS # show :: StoreBudget -> String # showList :: [StoreBudget] -> ShowS # | |
| Eq StoreBudget Source # | |
Defined in Ecluse.Core.Server.Cache.Types | |
The cache handle
data MetadataCache Source #
One provider supplies every retention capability beside process-local request coalescing.
newMetadataCache :: CacheConfig -> IO MetadataCache Source #
Select the shipped local provider without an external service dependency.
newMetadataCacheWithProvider :: CacheProvider -> IO MetadataCache Source #
Create only transient flight state. The selected provider owns every retained representation.
Cache entries
An upstream base URL partitions entries without carrying credentials.
data CacheEntry Source #
A typed view paired with its source representation and complete fetch digest.
Constructors
| CacheEntry | |
Fields
| |
Instances
| Show CacheEntry Source # | |
Defined in Ecluse.Core.Server.Cache.Types Methods showsPrec :: Int -> CacheEntry -> ShowS # show :: CacheEntry -> String # showList :: [CacheEntry] -> ShowS # | |
| Eq CacheEntry Source # | |
Defined in Ecluse.Core.Server.Cache.Types | |
Resolution
resolveMetadata :: MetricsPort -> MetadataCache -> Source -> PackageName -> IO (Either MetadataError CacheEntry) -> IO (Either MetadataError CacheEntry) Source #
Coalesce public metadata fetches. Failures reach all waiters and retain nothing.
metadataKey :: Source -> PackageName -> Text Source #
The key a full read of one package from one source is shared and retained under.
Single-version resolution
resolveVersion :: MetricsPort -> MetadataCache -> Source -> PackageName -> Version -> IO (Either MetadataError VersionRead) -> IO (Either MetadataError VersionRead) Source #
Cache a selectively decoded release or its absence. Oversized releases remain uncached.
prepareVersion :: MetricsPort -> MetadataCache -> Source -> PackageName -> Version -> IO (Either MetadataError VersionRead) -> IO (PreparedStore MetadataError VersionRead) Source #
Pin a selected local value, including absence, before any remote work.
Assembled-representation resolution
resolveAssembled :: MetricsPort -> MetadataCache -> Text -> IO ByteString -> IO ByteString Source #
Memoise a response under the content digest of this request's authorised inputs.