LangfuseClient class
把 LangfuseEvent 批量发到 POST /api/public/ingestion。
行为对齐 Langfuse 官方 SDK:
- 内部维护一个事件 queue
- 满 LangfuseConfig.flushAt 条立刻 flush
- 否则最长 LangfuseConfig.flushInterval flush 一次
- HTTP 失败按指数退避重试,最多 LangfuseConfig.maxRetries 次
- 关闭时 shutdown 强制 flush 完所有积压
仅暴露 enqueue / flush / shutdown 三个口子,TraceExporter 不 需要关心 HTTP / 重试 / 批处理。
Constructors
- LangfuseClient(LangfuseConfig config, {Dio? dio})
Properties
- config → LangfuseConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
enqueue(
LangfuseEvent event) → void - 把一条 event 放入队列。线程安全:只在 isolate-local 内调用。
-
enqueueAll(
Iterable< LangfuseEvent> events) → void - 多条版本,避免单条 enqueue 多次 schedule timer。
-
flush(
) → Future< void> - 把当前队列里的所有 event 发出去。串行化:同一时刻只有一个 在飞的 flush,避免重复发送。
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shutdown(
) → Future< void> - flush 剩余事件 + 释放定时器。调用后 enqueue 静默 no-op。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited