AdaptySDK 4.1.1
Loading...
Searching...
No Matches
AdaptySDK.AdaptyPlacementFetchPolicy Class Referencesealed

Whether a fetch may answer from the cache, and for how long. Pick one of the shared instances or build one with ReturnCacheDataIfNotExpiredElseLoad. More...

Public Member Functions

override string ToString ()
 A description for logs and the debugger. The format is not part of the contract — read the members rather than parsing it.

Static Public Member Functions

static AdaptyPlacementFetchPolicy ReturnCacheDataIfNotExpiredElseLoad (TimeSpan maxAge)
 Use the cache while it is younger than maxAge , and ask the server once it is older.

Static Public Attributes

static readonly AdaptyPlacementFetchPolicy ReloadRevalidatingCacheData
 Ask the server, and fall back to the cache when it cannot be reached. The default.
static readonly AdaptyPlacementFetchPolicy ReturnCacheDataElseLoad
 Use the cache when there is anything in it, however old, and only ask the server otherwise.
static readonly AdaptyPlacementFetchPolicy Default = ReloadRevalidatingCacheData
 The policy used when none is given — the same instance as ReloadRevalidatingCacheData.

Properties

double? MaxAgeInSeconds [get]
 The contract carries the age in seconds, not as a duration literal.

Private Member Functions

 AdaptyPlacementFetchPolicy (string type, TimeSpan? maxAge)

Private Attributes

readonly string _Type
readonly? TimeSpan _MaxAge

Detailed Description

Whether a fetch may answer from the cache, and for how long. Pick one of the shared instances or build one with ReturnCacheDataIfNotExpiredElseLoad.

Constructor & Destructor Documentation

◆ AdaptyPlacementFetchPolicy()

AdaptySDK.AdaptyPlacementFetchPolicy.AdaptyPlacementFetchPolicy ( string type,
TimeSpan? maxAge )
private

Member Function Documentation

◆ ReturnCacheDataIfNotExpiredElseLoad()

AdaptyPlacementFetchPolicy AdaptySDK.AdaptyPlacementFetchPolicy.ReturnCacheDataIfNotExpiredElseLoad ( TimeSpan maxAge)
static

Use the cache while it is younger than maxAge , and ask the server once it is older.

◆ ToString()

override string AdaptySDK.AdaptyPlacementFetchPolicy.ToString ( )

A description for logs and the debugger. The format is not part of the contract — read the members rather than parsing it.

Member Data Documentation

◆ _MaxAge

readonly? TimeSpan AdaptySDK.AdaptyPlacementFetchPolicy._MaxAge
private

◆ _Type

readonly string AdaptySDK.AdaptyPlacementFetchPolicy._Type
private

◆ Default

readonly AdaptyPlacementFetchPolicy AdaptySDK.AdaptyPlacementFetchPolicy.Default = ReloadRevalidatingCacheData
static

The policy used when none is given — the same instance as ReloadRevalidatingCacheData.

◆ ReloadRevalidatingCacheData

readonly AdaptyPlacementFetchPolicy AdaptySDK.AdaptyPlacementFetchPolicy.ReloadRevalidatingCacheData
static
Initial value:
= new(
"reload_revalidating_cache_data",
null
)

Ask the server, and fall back to the cache when it cannot be reached. The default.

◆ ReturnCacheDataElseLoad

readonly AdaptyPlacementFetchPolicy AdaptySDK.AdaptyPlacementFetchPolicy.ReturnCacheDataElseLoad
static
Initial value:
= new(
"return_cache_data_else_load",
null
)

Use the cache when there is anything in it, however old, and only ask the server otherwise.

Property Documentation

◆ MaxAgeInSeconds

double? AdaptySDK.AdaptyPlacementFetchPolicy.MaxAgeInSeconds
getprivate

The contract carries the age in seconds, not as a duration literal.


The documentation for this class was generated from the following file: