Skip to content

Conversation

@huangdijia
Copy link
Member

Summary

This PR adds enhanced result handling capabilities to the async queue system, allowing jobs to control their processing outcome through return values.

Changes

  • Added Result enum with ACK, REQUEUE, and DROP states
  • Modified Driver to handle different job processing results
  • Updated JobInterface to support return values
  • Enhanced message acknowledgment logic based on job return values

Features

  • Result::ACK: Acknowledge and remove message from queue (default)
  • Result::REQUEUE: Reject message and requeue for retry
  • Result::DROP: Reject message and drop it without retry
  • Maintains backward compatibility for existing jobs

This allows jobs to implement custom retry logic and control queue behavior dynamically.

- Added Result enum with ACK, REQUEUE, and DROP states
- Modified Driver to handle different job processing results
- Updated JobInterface to support return values
- Enhanced message acknowledgment logic based on job return values

This allows jobs to control their processing outcome:
- Return Result::ACK to acknowledge and remove from queue
- Return Result::REQUEUE to retry the job
- Return Result::DROP to remove without retry
- Default behavior maintains backward compatibility
@limingxinleo limingxinleo merged commit 196f346 into hyperf:master Nov 6, 2025
60 checks passed
@huangdijia huangdijia deleted the feature/async-queue-result-handling branch November 6, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants