- Basic task submission and processing: Demonstrate how to create a pool, add workers, and submit tasks for processing.
- Custom worker implementation: Show how to implement a custom worker that processes specific types of tasks.
- Retry mechanism with fixed delay: Illustrate how the pool retries tasks that fail, using a fixed delay policy.
- Exponential backoff retry policy: Showcase how to use an exponential backoff retry policy with jitter.
- Custom Retry Policy Function: Implement and use a custom retry policy function to determine retry delays.
- Rate limiting task submission: Demonstrate how to rate-limit task submissions to the pool.
- Handling Dead Tasks with Callback: Show how tasks that exceed retry attempts are moved to dead tasks and handled via a callback.
- Worker Lifecycle Management: Illustrate adding, pausing, resuming, and removing workers from the pool.
- Task Options: Immediate Retry and Bounce Retry: Demonstrate submitting tasks with immediate retry and bounce retry options.
- Task Timeouts and deadlines: Show how to set total and per-attempt timeouts for tasks.
- Custom Error Handling with retryIf Function: Implement a custom function to determine if a task error is retryable.
- Task Notifications: Utilize notifications to signal when tasks are queued and processed.
- Panic Handling: Demonstrate how the pool handles panics within worker tasks.
- Request Response: Use the
RequestResponse
type to manage tasks that require a response. - Dynamic Adjustment of Retry Policies: Change retry policies at runtime based on metrics or external signals.
- Testing Concurrency and Data Race Prevention: Create a high-concurrency scenario to test for data races and ensure thread safety.
- Graceful Shutdown and Cleanup: Demonstrate how to gracefully shut down the pool and ensure all tasks are completed or properly terminated.
- Error Handling and Specific Error Cases: Explore how the pool handles specific errors like
ErrPoolClosed
orErrMaxQueueSizeExceeded
. - Independent dependency pool: Dependent tasks executed in the right order, useful for data processing.
- Blocking dependency pool: Task that require a blocking mechanism (blocking a worker) by waiting another task, useful for workflow engines.