@mastra/core
Version:
70 lines (67 loc) • 1.78 kB
JavaScript
'use strict';
// src/worker/worker.ts
var MastraWorker = class {
mastra;
deps;
/** Called by Mastra during registration to provide the instance reference. */
__registerMastra(mastra) {
this.mastra = mastra;
}
/** Initialize with infrastructure deps. Called before start(). */
async init(deps) {
this.deps = deps;
if (!this.mastra && deps.mastra) {
this.mastra = deps.mastra;
}
}
};
// src/worker/transport/pull-transport.ts
var TOPIC_WORKFLOWS = "workflows";
var PullTransport = class {
constructor({
pubsub,
group,
topic,
logger
}) {
this.
this.
this.
this.
}
async start(router) {
if (this.
this.
return;
}
const cb = (event, ack, nack) => {
router.route(event, ack, nack).catch((err) => {
try {
if (typeof nack === "function") {
void nack();
}
} finally {
this.
}
});
};
await this.
this.
}
async stop() {
for (const { topic, cb } of this.
await this.
}
this.
await this.
}
};
exports.MastraWorker = MastraWorker;
exports.PullTransport = PullTransport;
//# sourceMappingURL=chunk-CWKMGK5K.cjs.map
//# sourceMappingURL=chunk-CWKMGK5K.cjs.map