UNPKG

actionhero

Version:

The reusable, scalable, and quick node.js API server for stateless and stateful applications

25 lines (24 loc) 871 B
export declare namespace redis { interface PubSubMessage { [key: string]: any; } /** * Publish a message to all other Actionhero nodes in the cluster. Will be authenticated against `api.config.serverToken` * ```js * let payload = { * messageType: 'myMessageType', * serverId: api.id, * serverToken: api.config.general.serverToken, * message: 'hello!' * } * * await api.redis.publish(payload) * ``` */ function publish(payload: object | Array<any>): Promise<number>; /** * Invoke a command on all servers in this cluster. */ function doCluster<T>(method: string, args?: Array<any>, connectionId?: string, waitForResponse?: boolean): Promise<T extends any ? T : unknown>; function respondCluster(messageId: string, response: PubSubMessage): Promise<void>; }