Skip to main content

Module io

Module io 

Source
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§

AsyncNdjsonWriter
Async wrapper around NdjsonWriter that runs the sync rotate-and-write on tokio::task::spawn_blocking to keep the tokio runtime unblocked.
FileWriterConfig
Shared file writer configuration.
NdjsonWriter
NDJSON file writer with automatic rotation and metrics.

Enums§

RotationPeriod
File rotation period.