@genkit-ai/core
Version:
Genkit AI framework core libraries.
37 lines • 797 B
JavaScript
class RealtimeSpanProcessor {
constructor(exporter) {
this.exporter = exporter;
}
/**
* Called when a span is started. Exports immediately for real-time updates.
*/
onStart(span, _parentContext) {
this.exporter.export([span], () => {
});
}
/**
* Called when a span ends. Exports again with complete data.
*/
onEnd(span) {
this.exporter.export([span], () => {
});
}
/**
* Forces the exporter to flush any buffered spans.
*/
async forceFlush() {
if (this.exporter.forceFlush) {
return this.exporter.forceFlush();
}
}
/**
* Shuts down the processor and exporter.
*/
async shutdown() {
return this.exporter.shutdown();
}
}
export {
RealtimeSpanProcessor
};
//# sourceMappingURL=realtime-span-processor.mjs.map