Module reactive_mutiny::stream_executor
source · Expand description
Contains the logic for executing [Stream] pipelines on their own Tokio tasks with zero-cost Instruments options for gathering stats,
logging and so on.
Four executors are provided to attend to different Stream output item types:
- Items that are non-futures & non-fallible. For instance,
Stream::Item = String - Items that are futures, but are non-fallible:
Stream::Item = Future<Output=DataType>– DataType may be, for instance, String - Items that are non-futures, but are fallible:
Stream::Item = Result<DataType, Box<dyn std::error::Error>> - Items that are fallible futures:
Stream::Item = Future<Output=Result<DataType, Box<dyn std::error::Error>>>– allowing futures to time out
Apart from handling the specifig return types, logging & filling in the available metrics, all executors does the same things:
- Register start & finish metrics
- Log start (info), items (trace) and finish (warn)
Specific executors does additional work:
- Streams that returns a
Resultcomputes how many errors occurred and calls the providedon_err_callback(), as well as logging errors that made it all through the pipeline and showed up on the executor (untreated errors) - Streams that returns a
Futurewill, optionally, compute the time for each future to complete and, also optionally, register a time out for each future to be completed
Structs
- See Instruments