Crate fuel_core_services

Source
Expand description

Common traits and logic for managing the lifecycle of services

Re-exports§

pub use seqlock::SeqLock;
pub use seqlock::SeqLockReader;
pub use seqlock::SeqLockWriter;

Modules§

seqlock
A simple implementation of a sequential lock. More details: https://docs.kernel.org/locking/seqlock.html
stream
Re-exports for streaming utilities
yield_stream
Stream that yields each batch_size items allowing other tasks to work.

Structs§

AsyncProcessor
A processor that can execute async tasks with a limit on the number of tasks that can be executed concurrently.
EmptyShared
Used if services have no asynchronously shared data
ServiceRunner
The service runner manages the lifecycle, execution and error handling of a RunnableService. It can be cloned and passed between threads.
SharedMutex
A mutex that can safely be in async contexts and avoids deadlocks.
StateWatcher
The wrapper around the watch::Receiver<State>. It repeats the Receiver functionality + a new one.

Enums§

State
The lifecycle state of the service
TaskNextAction
The result of a single iteration of the service task

Traits§

RunnableService
Trait used by ServiceRunner to encapsulate the business logic tasks for a service.
RunnableTask
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.
TraceErr
Helper trait to trace errors

Type Aliases§

Shared
Alias for Arc<T>