Available on crate feature
io only.Expand description
Shared NDJSON file I/O primitives.
Provides NdjsonWriter – a rotating file writer for newline-delimited JSON.
Used by both the DLQ file backend and the file output sink.
§Design
NdjsonWriter is a thin wrapper around file-rotate that handles:
- Rotating NDJSON files by time (hourly/daily)
- Optional gzip compression of rotated files
- Age-based cleanup of old files
- Atomic write counters for metrics
It knows nothing about DLQ or output semantics – callers serialise their
own types and hand raw &[u8] lines to the writer.
Structs§
- Async
Ndjson Writer - Async wrapper around
NdjsonWriterthat runs the sync rotate-and-write ontokio::task::spawn_blockingto keep the tokio runtime unblocked. - File
Writer Config - Shared file writer configuration.
- Ndjson
Writer - NDJSON file writer with automatic rotation and metrics.
Enums§
- Rotation
Period - File rotation period.