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 specific return types, logging & filling in the available metrics, all executors do the same things:
- Register start & finish metrics
- Log start (info), items (trace) and finish (warn)
Specific executors do additional work:
- Streams that returns a
Result: logs & counts untreated-errors (errors that made it all the way through the pipeline and ended up in the executor), calling the providedon_err_callback(); - Streams that returns a
Future: they will, optionally, compute the time for each future to complete and, also optionally, register a time out for each future to be completed – cancelling theFutureif it exceeds the time budget.
Structs
- See Instruments