File based backends
File-based backend for persisting tasks and results. Currently only supports JSON.
Features
- Sink support: Ability to push new tasks.
- Codec Support: Serialization support for arguments using JSON.
- Workflow Support: Flexible enough to support workflows.
- Ack Support: Allows acknowledgement of task completion.
- WaitForCompletion: Wait for tasks to complete without blocking.
Usage Example
use JsonStorage;
use WorkerBuilder;
use Duration;
use WorkerContext;
use TaskSink;
use BoxDynError;
use EventListenerExt;
async
Implementation Notes
- Tasks are stored in a file, each line representing a serialized task entry.
- All operations are thread-safe using
RwLock. - Data is atomically persisted to disk to avoid corruption.
- Supports temporary storage for testing and ephemeral use cases.