feature: add ackwait config#75
Conversation
WalkthroughAdded a non-negative integer Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Queue/NatsCreateInfo.php(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/Queue/NatsCreateInfo.php (4)
src/Queue/AMQPCreateInfo.php (1)
__construct(39-69)src/Queue/SQSCreateInfo.php (1)
__construct(50-71)src/Queue/BeanstalkCreateInfo.php (1)
__construct(25-38)src/Queue/CreateInfo.php (1)
__construct(19-26)
🔇 Additional comments (3)
src/Queue/NatsCreateInfo.php (3)
18-18: LGTM: Constant definition is appropriate.The constant follows the established pattern and a default value of 0 is reasonable for an acknowledgement wait timeout.
27-27: LGTM: Documentation is correct.The docblock properly documents the parameter type and constraints.
60-60: LGTM: Serialization is correctly implemented.The array key uses snake_case naming consistent with other fields, and the serialization follows the established pattern. Once the type mismatch on line 39 is corrected, this will function properly.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Queue/NatsCreateInfo.php(4 hunks)tests/Unit/Queue/NatsCreateInfoTest.php(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Queue/NatsCreateInfo.php
🔇 Additional comments (3)
tests/Unit/Queue/NatsCreateInfoTest.php (3)
24-26: LGTM!The constructor call correctly includes the new
ackWaitparameter with a value of0.
52-54: LGTM!The constructor call is consistent with the first test and correctly includes the new
ackWaitparameter.
67-67: LGTM!The expected array correctly includes the new
ack_waitfield with the appropriate value and naming convention.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Queue/Kafka/ConsumerOffset.php (1)
12-16: Consider adding validation for the$valueparameter constraint.The docblock specifies
int<0,max>|nullfor$value, but there's no runtime assertion to enforce that$value >= 0when provided. This inconsistency is notable given that the relatedNatsCreateInfoclass (mentioned in the PR summary) includes an assertion for its similarackWaitparameter.Apply this diff to add validation:
public function __construct( public readonly OffsetType $type, public readonly ?int $value = null, ) { + assert($value === null || $value >= 0, 'Value must be non-negative'); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Queue/Kafka/ConsumerOffset.php(1 hunks)
🔇 Additional comments (1)
src/Queue/Kafka/ConsumerOffset.php (1)
7-7: No breaking changes detected—the class is safe to make final.The codebase contains no extensions of
ConsumerOffset. The class is used only through composition (as a property type inConsumePartitionandConsumerOptions) and direct instantiation in tests. Making it final is not a breaking change and aligns well with the class's immutable data-holding design.
related to roadrunner-server #190
Summary by CodeRabbit