Skip to main content

Interface: PayloadCache

Experimental

Generic interface for a payload cache.

Implementations should not throw or reject. The SDK treats a failed get as a miss and ignores a failed set.

Methods​

get()​

get(key): Promise<IPayload | undefined>

Experimental

Returns the payload stored under key, or undefined on a miss.

Parameters​

key​

string

Returns​

Promise<IPayload | undefined>


set()​

set(key, payload): Promise<boolean>

Experimental

Returns whether the cache accepted payload.

Parameters​

key​

string

payload​

IPayload

Returns​

Promise<boolean>