@hotmeshio/hotmesh
Version:
Permanent-Memory Workflows & AI Agents
32 lines (31 loc) • 958 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectionService = void 0;
/**
* The Connection service is used to declare the class
* and connection options but does not connect quite yet. Connection
* happens at a later lifecycle stage when a workflow
* is started by the MemFlow Client module (`(new MemFlow.Client())).start()`).
*
* The config options optionall support a multi-connection setup
* where the `store` connection explicitly defined along with `stream`, `sub`, etc.
*/
class ConnectionService {
/**
* @private
*/
constructor() { }
/**
* Instance initializer
*/
static async connect(config) {
return 'store' in config
? config
: {
class: config.class,
options: { ...config.options },
provider: config.provider,
};
}
}
exports.ConnectionService = ConnectionService;