Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Examples

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