@hotmeshio/hotmesh
Version:
Serverless Workflow
27 lines (26 loc) • 716 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.RedisConnection = void 0;
const __1 = require("..");
class RedisConnection extends __1.AbstractConnection {
constructor() {
super(...arguments);
this.defaultOptions = {
host: 'localhost',
port: 6379,
};
}
async createConnection(Redis, options) {
return new Redis(options);
}
getClient() {
if (!this.connection) {
throw new Error('Redis client is not connected');
}
return this.connection;
}
async closeConnection(connection) {
await connection.quit();
}
}
exports.RedisConnection = RedisConnection;
;