Add with_origin convenience method to Client and Server#1153
Conversation
Combines with_publish and with_consume into a single call by accepting an OriginProducer and deriving the OriginConsumer via origin.consume(). https://claude.ai/code/session_01BR7nZNehx4JkvZrKfaiaAt
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe pull request adds a new 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Summary
Added a new
with_origin()convenience method to bothClientandServerthat simplifies the common pattern of setting both publish and consume from anOriginProducer.Key Changes
with_origin()method toClientthat accepts anOriginProducerand configures both publish and consume in a single callwith_origin()method toServerfor consistencywith_publish()andwith_consume()methodsImplementation Details
The
with_origin()method is a convenience wrapper that:origin.consume()to extract the consumerwith_publish(consumer)andwith_consume(origin)to configure both directionsThis eliminates the need for callers to manually extract the consumer and make two separate method calls, improving API ergonomics.
https://claude.ai/code/session_01BR7nZNehx4JkvZrKfaiaAt