-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #998]📝Add doc for MQConsumerInner #999
Conversation
WalkthroughThe pull request introduces a new trait, Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The `MQConsumerInnerLocal` trait defines the core functionalities required for a local MQ | ||
/// consumer. It extends the `MQConsumerInnerAny` trait and requires implementations to be `Sync` | ||
/// and `'static`. | ||
|
||
#[trait_variant::make(MQConsumerInner: Send)] | ||
pub trait MQConsumerInnerLocal: MQConsumerInnerAny + Sync + 'static { | ||
/// Returns the group name of the consumer. | ||
fn group_name(&self) -> String; | ||
|
||
/// Returns the message model used by the consumer. | ||
fn message_model(&self) -> MessageModel; | ||
|
||
/// Returns the type of consumption (e.g., push or pull). | ||
fn consume_type(&self) -> ConsumeType; | ||
|
||
/// Returns the point from where the consumer should start consuming messages. | ||
fn consume_from_where(&self) -> ConsumeFromWhere; | ||
|
||
/// Returns the set of subscriptions for the consumer. | ||
fn subscriptions(&self) -> HashSet<SubscriptionData>; | ||
|
||
/// Performs the rebalancing of the consumer. | ||
fn do_rebalance(&self); | ||
|
||
/// Attempts to perform rebalancing asynchronously and returns a `Result` indicating success or | ||
/// failure. | ||
async fn try_rebalance(&self) -> Result<bool>; | ||
|
||
/// Persists the consumer offset asynchronously. | ||
async fn persist_consumer_offset(&self); | ||
|
||
/// Updates the subscription information for a given topic asynchronously. | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `topic` - A string slice that holds the name of the topic. | ||
/// * `info` - A reference to a `HashSet` containing `MessageQueue` information. | ||
async fn update_topic_subscribe_info(&mut self, topic: &str, info: &HashSet<MessageQueue>); | ||
|
||
/// Checks if the subscription information for a given topic needs to be updated asynchronously. | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `topic` - A string slice that holds the name of the topic. | ||
/// | ||
/// # Returns | ||
/// | ||
/// * `bool` - `true` if the subscription information needs to be updated, `false` otherwise. | ||
async fn is_subscribe_topic_need_update(&self, topic: &str) -> bool; | ||
|
||
/// Returns whether the consumer is in unit mode. | ||
fn is_unit_mode(&self) -> bool; | ||
|
||
/// Returns the running information of the consumer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify the introduction of the MQConsumerInnerLocal
trait
The PR aims to add documentation for the MQConsumerInner
trait, but the code introduces a new trait MQConsumerInnerLocal
instead. Additionally, there are no implementations of MQConsumerInnerLocal
provided in the codebase. If the intention was to document the existing MQConsumerInner
trait, please update the documentation accordingly. If MQConsumerInnerLocal
is meant to be a new trait, ensure that it's properly integrated with implementations and that its purpose is clearly documented.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #999 +/- ##
=======================================
Coverage 19.49% 19.49%
=======================================
Files 412 412
Lines 34235 34237 +2
=======================================
+ Hits 6673 6676 +3
+ Misses 27562 27561 -1 ☔ View full report in Codecov by Sentry. |
Which Issue(s) This PR Fixes(Closes)
Fixes #998
Brief Description
How Did You Test This Change?
Summary by CodeRabbit