Update index.md for adding addOnAnyEventListener (catch all events listener) #64
Update index.md for adding addOnAnyEventListener (catch all events listener) #64NeatGuyCoding merged 1 commit intomainfrom
Conversation
WalkthroughDocumentation added for listening to all client-emitted events via Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/api/index.md (1)
58-63: Document both API variants with examples.The documentation introduces two equivalent APIs (
addOnAnyEventListenerandonAny) but only the example usesaddOnAnyEventListener. Adding a brief example or note clarifying that both are equivalent would improve clarity for users deciding which to use.Consider adding a note like:
Both APIs are equivalent; choose based on your coding style preference: - `server.addOnAnyEventListener(...)` - Method chaining style - `server.onAny(...)` - Shorter aliasOr provide a brief second example:
// Alternative syntax using onAny alias server.onAny((client, event, args, ackRequest) -> { // Handle any event });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/api/index.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build (17) / build
- GitHub Check: build (21) / build
- GitHub Check: build (25) / build
🔇 Additional comments (2)
docs/api/index.md (2)
66-83: Code example is clear and practical.The example demonstrates proper usage of the catch-all listener: accessing client metadata, iterating arguments, and handling acknowledgments. The null-safety check with
isAckRequested()before sending ack data is a good defensive pattern to highlight.
84-88: Acknowledgement rules are well-documented.The three bullet points clearly explain the ack semantics: when acks are requested, the "first-wins" behavior, and what happens to subsequent ack attempts. This is important context that prevents common mistakes.
|
LGTM |
Description
Brief description of the changes in this PR.
Type of Change
Related Issue
Closes #(issue number)
Changes Made
Testing
mvn testChecklist
Additional Notes
Any additional information, screenshots, or context that reviewers should know.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.