Table of Contents

Interface IRemoteContentCallService

Namespace
Quilt4Net.Toolkit.Features.Content
Assembly
Quilt4Net.Toolkit.dll
public interface IRemoteContentCallService

Properties

ObservedContentTtl

The content lifetime the server most recently reported on a successful bulk warm-up, or null when none has succeeded yet. Drives the periodic re-warm interval, so the client follows the server's TTL instead of guessing at it.

TimeSpan? ObservedContentTtl { get; }

Property Value

TimeSpan?

Remarks

A default implementation returning null is provided so adding this member does not break existing implementers of this public interface; a caller that gets null falls back to its own interval.

Methods

ClearContentCacheAsync()

Task ClearContentCacheAsync()

Returns

Task

GetCacheCountsByLanguage()

Number of currently-cached content entries grouped by language key — i.e. how much content has been loaded so far per language (warm-up + lazy loads). For diagnostics/admin display.

IReadOnlyDictionary<Guid, int> GetCacheCountsByLanguage()

Returns

IReadOnlyDictionary<Guid, int>

GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>)

Task<(string Value, bool Success)> GetContentAsync(string key, string defaultValue, Guid languageKey, ContentFormat? contentType, string application = null, IReadOnlyDictionary<string, string> translations = null)

Parameters

key string
defaultValue string
languageKey Guid
contentType ContentFormat?
application string
translations IReadOnlyDictionary<string, string>

Returns

Task<(string Value, bool Success)>

GetContentResultAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>)

As GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>), but also reports where the value came from. Prefer this when the caller needs to tell a server value apart from a cached one or a fallback default.

Task<ContentResult> GetContentResultAsync(string key, string defaultValue, Guid languageKey, ContentFormat? contentType, string application = null, IReadOnlyDictionary<string, string> translations = null)

Parameters

key string
defaultValue string
languageKey Guid
contentType ContentFormat?
application string
translations IReadOnlyDictionary<string, string>

Returns

Task<ContentResult>

GetLanguagesAsync(bool)

Task<Language[]> GetLanguagesAsync(bool forceReload)

Parameters

forceReload bool

Returns

Task<Language[]>

GetManyContentAsync(IReadOnlyCollection<ContentRequest>, Guid, ContentFormat?, string)

Resolve a set of keys together. Anything already cached is served from there; a cold language is warmed once in bulk rather than a call per key; only keys the server has genuinely never seen still cost a round trip each, and those no longer block the caller (see MaterializationWait).

Task<IReadOnlyDictionary<string, string>> GetManyContentAsync(IReadOnlyCollection<ContentRequest> requests, Guid languageKey, ContentFormat? contentType, string application = null)

Parameters

requests IReadOnlyCollection<ContentRequest>
languageKey Guid
contentType ContentFormat?
application string

Returns

Task<IReadOnlyDictionary<string, string>>

Remarks

A default implementation is provided so adding this member does not break existing implementers; it loops the single-key path.

SetContentAsync(string, string, Guid, ContentFormat, string)

Task SetContentAsync(string key, string defaultValue, Guid languageKey, ContentFormat contentType, string application = null)

Parameters

key string
defaultValue string
languageKey Guid
contentType ContentFormat
application string

Returns

Task

WarmCacheAsync(Guid, string)

Pre-fill the local cache for an entire application + language in one bulk call (the startup warm-up). Eliminates the per-key fan-out on cold load. Best-effort: a missing endpoint (old server, 404), failure, or timeout is swallowed so the normal per-key path still serves content. application follows the usual convention (null → resolve).

Task WarmCacheAsync(Guid languageKey, string application = null)

Parameters

languageKey Guid
application string

Returns

Task

WarmConfiguredLanguagesAsync(string)

Warm the default language plus every language named in WarmUpLanguages in one bulk call each. Used by the startup warm-up and by "Reload Content". A configured name with no matching server language is skipped with a Warning. Best-effort throughout, like WarmCacheAsync(Guid, string).

Task WarmConfiguredLanguagesAsync(string application = null)

Parameters

application string

Returns

Task