JsonlBatchWriter<T> class

A utility that combines Batcher and an IOSink to efficiently write high-frequency data to a JSONL file in batches.

Constructors

JsonlBatchWriter({required File file, int? maxBatchSize = 100, Duration? maxDuration = const Duration(milliseconds: 100), void onError(Object error, StackTrace stackTrace)?})
Creates a JsonlBatchWriter that lazily appends to the provided file.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(T item) → void
Adds an item to the internal buffer to be written to the file.
dispose() Future<void>
Flushes any pending items to disk and safely closes the file handle.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited