Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisCache

Class RedisCache. Implements cache engine over redis.

Hierarchy

  • RedisCache

Implements

Index

Properties

Methods

Properties

name

name: string = RedisCache.name

options

ready

ready: boolean = false

Methods

del

  • del(key: string): Promise<boolean>

get

  • get(key: string): Promise<any>

init

set

  • set(key: string, value: any, ttl?: undefined | number, nx?: boolean): Promise<boolean>
  • Stores in cache given value under given key. If TTL is specified, cached value will expire in a given number of milliseconds. If NX argument set to true will create key:value in cache only if it does not exists yet. Given value could be any JSON-compatible object and will be serialized automatically.

    Parameters

    • key: string
    • value: any
    • Optional ttl: undefined | number
    • Default value nx: boolean = false

    Returns Promise<boolean>

Static destroy

  • destroy(): Promise<void>