meathook/lib.rs
1//! # meathook
2//!
3//! A polling runtime with composable, durable sinks: poll a source on an
4//! interval, buffer samples into time windows, and ship them to long-term
5//! storage — durably.
6//!
7//! The core (traits, sink combinators, write-ahead spool, supervised
8//! runtime) is free of any HTTP/IO stack dependency: with
9//! `--no-default-features` you get just that and bring your own collector
10//! and terminal sink.
11//!
12//! The two core abstractions are:
13//!
14//! - [`Collector`]: produces a batch of records per tick. With the `satay`
15//! feature, [`satay::SatayCollector`] adapts any
16//! [satay](https://docs.rs/satay-runtime)-generated API client into a
17//! collector.
18//! - [`Sink`]: receives records. Sinks compose like tower layers — a
19//! buffering tier ([`Buffered`]), a durable write-ahead spool
20//! ([`DiskSpool`]), fan-out ([`Tee`]), and terminal sinks such as
21//! [`HfSink`](sink::huggingface::HfSink) (feature `huggingface`) stack via
22//! [`SinkExt`].
23//!
24//! Pipelines (collector + sink stack) are supervised by the [`Meathook`]
25//! runtime: one tokio task each, respawn-on-panic with backoff, and a final
26//! `flush()` through the whole stack on graceful shutdown.
27
28pub mod collector;
29#[cfg(feature = "parquet")]
30pub mod encode;
31pub mod layer;
32pub mod pipeline;
33pub mod runtime;
34#[cfg(feature = "satay")]
35pub mod satay;
36pub mod sink;
37
38#[cfg(test)]
39pub(crate) mod test_util;
40
41pub use collector::Collector;
42pub use layer::{Buffered, DiskSpool, FlushPolicy, SinkExt, SpoolError, Tee, TeeError};
43pub use pipeline::Pipeline;
44pub use runtime::{Meathook, MeathookBuilder, RuntimeError};
45#[cfg(feature = "satay")]
46pub use satay::SatayCollector;
47pub use sink::{Sink, WindowMeta};
48
49#[cfg(feature = "parquet")]
50pub use encode::EncodeError;
51#[cfg(feature = "huggingface")]
52pub use sink::huggingface::{HfSink, HfSinkError};