Expand description
Common traits and logic for managing the lifecycle of services
Modules§
- stream
- Re-exports for streaming utilities
- yield_
stream - Stream that yields each
batch_sizeitems allowing other tasks to work.
Structs§
- Async
Processor - A processor that can execute async tasks with a limit on the number of tasks that can be executed concurrently.
- Empty
Shared - Used if services have no asynchronously shared data
- Service
Runner - The service runner manages the lifecycle, execution and error handling of a
RunnableService. It can be cloned and passed between threads. - Shared
Mutex - A mutex that can safely be in async contexts and avoids deadlocks.
- State
Watcher - The wrapper around the
watch::Receiver<State>. It repeats theReceiverfunctionality + a new one.
Enums§
- State
- The lifecycle state of the service
Traits§
- Runnable
Service - Trait used by
ServiceRunnerto encapsulate the business logic tasks for a service. - Runnable
Task - The trait is implemented by the service task and contains a single iteration of the infinity loop.
- Service
- Trait for service runners, providing a minimal interface for managing the lifecycle of services such as start/stop and health status.
- Trace
Err - Helper trait to trace errors
Type Aliases§
- Shared
- Alias for
Arc<T>