hubcio commented on code in PR #3913:
URL: https://github.com/apache/iggy/pull/3913#discussion_r3806121904
##########
core/sdk/src/clients/consumer.rs:
##########
@@ -229,26 +539,48 @@ impl IggyConsumer {
}
/// Returns the name of the consumer.
+ ///
+ /// For a consumer group this is also the name of the group.
pub fn name(&self) -> &str {
&self.consumer_name
}
- /// Returns the topic ID of the consumer.
+ /// Returns the identifier of the topic this consumer reads from.
pub fn topic(&self) -> &Identifier {
&self.topic_id
}
- /// Returns the stream ID of the consumer.
+ /// Returns the identifier of the stream this consumer reads from.
pub fn stream(&self) -> &Identifier {
&self.stream_id
}
- /// Returns the current partition ID of the consumer.
+ /// Returns the partition the last message came from.
+ ///
+ /// This is `0` until the first message has been read, because a partition
is only known once
+ /// the server has answered. For a consumer group the value changes over
time, as the server
+ /// can hand different partitions to this member.
pub fn partition_id(&self) -> u32 {
self.current_partition_id.load(ORDERING)
}
- /// Stores the consumer offset on the server either for the current
partition or the provided partition ID.
+ /// Stores an offset on the server, marking every message up to and
including it as consumed.
+ ///
+ /// This is the manual counterpart to [`AutoCommit`] and is meant for
+ /// [`AutoCommit::Disabled`].
+ ///
+ /// Pass `None` as `partition_id` to use the partition of the most recent
batch polled.
+ ///
+ /// An offset that is not ahead of the last one this consumer stored for
that partition is
+ /// skipped and `Ok(())` is returned without a request.
+ /// If you to re-read messages again, e.g. want to move an offset
backwards configure the consumer
Review Comment:
those are suggestions of my LLM:
```
576
/// To re-read messages, e.g. to move an offset backwards, configure the
consumer
658
/// - the consumer's `stream_id` and `topic_id` exist on the server.
671
/// Calling init spawns a background task that listens for lifecycle changes
([`DiagnosticEvent`]s) of the
742
// Retry for init_retries times, waiting interval between retries.
805
// If the configuration defines a time interval at which the offset should
be stored,
915
// Wait until either the interval has passed or
1482
// A previously used (and therefore invalid) future was dropped, thus create
a fresh one.
1666
// Store the latest offset for each partition, if the consumed offset
371-372
/// ([`StreamExt::next`]) and [`shutdown()`](Self::shutdown) take exclusive
access (`&mut self`).
/// Hence, one task owns and drives a given consumer end to end.
385
/// Note that just dropping an `IggyConsumer` loses everything that is
currently in-flight.
("Note, that" also wrong, drop comma.)
360
/// key. This is guaranteed if you spawned both the [`IggyProducer`] and the
[`IggyConsumer`] from the same [`IggyClient`].
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]