export = Redis; /** * @class Redis * @extends Service * @param {object} config * @property service */ declare class Redis extends Service { connected: boolean; client: any; commands: {}; adapterName: any; pingIntervalID: NodeJS.Timeout; logger: import("../../kuzzle/Logger").Logger; /** * Setup a ping interval to keep the connection alive * Every 60 seconds a ping is sent to Redis */ _setupKeepAlive(delay: any): void; /** * Ping Redis */ _ping(): Promise; /** * Initializes the Redis commands list, and add transformers when necessary */ setCommands(): void; /** * Returns all the keys matching a given pattern. * * /!\ We don't use `keys` to avoid blocking Redis if using a big dataset * cf: http://redis.io/commands/keys * and http://redis.io/commands/scan * * @param pattern * @returns {Promise.} promise resolving to an array of keys */ searchKeys(pattern: any): Promise; /** * Executes multiple client commands in a single action * * @returns {Promise} */ mExecute(commands: any): Promise; _searchNodeKeys(node: any, pattern: any): Bluebird; _buildClient(options: any): any; _buildClusterClient(options: any): IORedis.Cluster; /** * Convenience method: set a key and its value * * Options: * - onlyIfNew: if true, set the NX option * - ttl: if true, set the PX option * * @param {string} key * @param {string} value * @param {{onlyIfNew: boolean, ttl: number}} [options] * @return {boolean} true if the key was set, false otherwise */ store(key: string, value: string, { onlyIfNew, ttl }?: { onlyIfNew: boolean; ttl: number; }): boolean; /** * Executes a client command * @param {string} command * @param {Array} args * @return {Promise.<*>} */ exec(command: string, ...args: any[]): Promise; } import Service = require("../service"); import Bluebird = require("bluebird"); import IORedis = require("ioredis");