Home > @imqueue/rpc > ICache > set

ICache.set() method

Stores the given value in the cache under the given key.

Signature:

set(key: string, value: any, ttl?: number): Promise<boolean>;

Parameters

Parameter

Type

Description

key

string

key to store the value under

value

any

value to store

ttl

number

(Optional) time-to-live in milliseconds

Returns:

Promise<boolean>

{Promise}