Expand description
Core traits for interacting with backends
The core traits and types for backends, responsible for providing sources of tasks, handling their lifecycle, and exposing middleware for internal processing. The traits here abstract over different backend implementations, allowing for extensibility and interoperability.
§Overview
Backend: The primary trait representing a task source, defining methods for polling tasks, heartbeats, and middleware.TaskSink: An extension trait for backends that support pushing tasks.FetchById,Update,Reschedule: Additional traits for managing tasks.Vacuum,ResumeById,ResumeAbandoned: Traits for backend maintenance and task recovery.RegisterWorker,ListWorkers,ListTasks: Traits for worker management and task listing.WaitForCompletion: A trait for waiting on task completion and checking their status.
§Default Implementations
The module includes several default backend implementations, such as:
MemoryStorage: An in-memory backend for testing and lightweight use casesPipe: A simple pipe-based backend for inter-thread communicationCustomBackend: A flexible backend allowing custom functions for task management
Modules§
- codec
- Utilities for encoding and decoding task arguments and results
- custom
- Custom Backend
- guide
- A guide to using the implementing a backend Guide for implementing backends
- json
json - File based Backend using JSON
- memory
- In-memory backend based on channels
- pipe
- Pipe streams to backends
- poll_
strategy - Polling strategies for backends.
- queue
- Represents a queue in the backend
- shared
- Shared connection support for backends
Structs§
- Filter
- Filter criteria for listing tasks
- Queue
Info - Represents information about a specific queue in the backend
- Running
Worker - Represents a worker currently registered with the backend
- Statistic
- Represents an overview of the backend including queues, workers, and statistics
- Task
Result - Represents the result of a task execution
Enums§
- Stat
Type - Statistics type
- Task
Sink Error - Error type for TaskSink operations
Traits§
- Backend
- The
Backendtrait defines how workers get and manage tasks from a backend. - Backend
Ext - Defines the encoding/serialization aspects of a backend.
- Config
Ext - Extension trait for accessing queue configuration
- Expose
- Allows exposing additional functionality from the backend
- Fetch
ById - Allows fetching a task by its ID
- List
AllTasks - Allows listing tasks across all queues with optional filtering
- List
Queues - Allows listing all queues available in the backend
- List
Tasks - Allows listing tasks with optional filtering
- List
Workers - Allows listing all workers registered with the backend
- Metrics
- Allows collecting metrics from the backend
- Register
Worker - Allows registering a worker with the backend
- Reschedule
- Allows rescheduling a task for later execution
- Resume
Abandoned - Allows fetching multiple tasks by their IDs
- Resume
ById - Allows resuming a task by its ID
- Task
Sink - Extends Backend to allow pushing tasks into the backend
- Update
- Allows updating an existing task
- Vacuum
- Allows cleaning up resources in the backend
- Wait
ForCompletion - Allows waiting for tasks to complete and checking their status
Type Aliases§
- Task
Stream - Represents a stream for T.