Improve documentation#9
Conversation
The `waitTTL` parameter of lock()/lockRead() was documented only as "how long to wait to acquire lock until returning false", with no mention of what the default value of 0 does. The README intro further implied the call always blocks until the lock is released, which is misleading. Per the RoadRunner lock plugin (roadrunner-server/lock, rpc.go): a wait of 0 is floored to defaultImmediateTimeout (1ms), so the call is effectively non-blocking and returns false almost immediately when the resource is already locked; a positive wait blocks up to that duration. Clarify the docblocks and README accordingly so the behavior no longer has to be reverse-engineered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughThis PR updates ChangesLock wait semantics documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 50-55: The README still uses the old wait parameter name in the
lock documentation, which conflicts with the PHP API. Update the prose and both
examples for lock() and lockRead() to use waitTTL consistently instead of wait,
and make sure the surrounding text describes the timeout using the same symbol
so copied snippets match the actual method signatures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 64ed6282-2c05-4ad6-9a6f-2d818d8e87f2
📒 Files selected for processing (3)
README.mdsrc/Lock.phpsrc/LockInterface.php
Consolidate resource/id/ttl/wait types, units (seconds or DateInterval), defaults and the return value into a single scannable table, so the per-argument behavior no longer has to be pieced together from prose and the source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The named-argument examples used `wait:`, but the parameter is `$waitTTL`, so the snippets would fail with "Unknown named parameter $wait". Rename the parameter references (named args, prose, table) to `waitTTL` so copied snippets match lock()/lockRead(). Addresses CodeRabbit review feedback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Clarify what the
waitTTLparameter oflock()/lockRead()does, in both the docblocks (LockInterface,Lock) and the README.Why
waitTTLwas documented only as "how long to wait to acquire lock until returning false", with nothing about the default value of0. Worse, the README intro states other processes "will be blocked until the lock isreleased", which implies the call always blocks — the opposite of the default behavior.
Behavior verified against the server plugin (
roadrunner-server/lock,rpc.go):