UNPKG

node-universe

Version:

基于 Nodejs 环境的一款微服务框架,原理来自于宇宙中的恒星,行星,卫星等系统。

29 lines (28 loc) 1.07 kB
import BaseCacher from './base'; import { RedisCacherOptions } from '../../typings/cachers'; import Redlock from 'redlock'; import Star from '../star'; import { Serialize } from '../../typings/serializers'; export default class RedisCacher extends BaseCacher { pingIntervalHandle: any; redlock: Redlock | null; redlockNonBlocking: Redlock | null; client: any; serializer: Serialize | null; constructor(options: RedisCacherOptions); init(star: Star): void; close(): Promise<any>; get(key: string): Promise<any>; set(key: string, data: any, ttl?: number | undefined): Promise<any>; delete(key: string | string[]): Promise<any>; clean(match?: string | string[]): Promise<any>; getWithTTL(key: string): Promise<any>; lock(key: string | string[], ttl?: number): Promise<any>; tryLock(key: string | string[], ttl?: number): Promise<any>; private _sequentialPromises; private _scanDel; private _clusterScanDel; private _nodeScanDel; getCacheKeys(): Promise<any>; private _handleMissingRedlock; }