Skip to content

Conversation

@slbotbm
Copy link
Contributor

@slbotbm slbotbm commented Jan 10, 2026

continuing the work of #2169

cstruct and others added 5 commits January 10, 2026 20:35
This adds a `.iter()` method for asynchronously iterating over Iggy
messages from a consumer. Adding this method requires the consumer
group to be initialized so `consumer_group` is made async and
initialization is made upfront. `partition_id` is also exposed on
`ReceiveMessage` to allow manual commit of offsets.
@slbotbm slbotbm force-pushed the extend-consumer-group-interface branch from 25acc33 to 9df56c8 Compare January 10, 2026 12:01
Comment on lines +133 to +143
/// Asynchronously iterate over `ReceiveMessage`s.
///
/// Returns an async iterator that raises `StopAsyncIteration` when no more messages are available
/// or a `PyRuntimeError` on failure.
///
/// Note: This method does not currently support `AutoCommit.After`.
/// For `AutoCommit.IntervalOrAfter(datetime.timedelta, AutoCommitAfter)`,
/// only the interval part is applied; the `after` mode is ignored.
/// Use `consume_messages()` if you need commit-after-processing semantics.
#[gen_stub(override_return_type(type_repr="collections.abc.AsyncIterator[ReceiveMessage]", imports=("collections.abc")))]
fn iter_messages<'a>(&self) -> ReceiveMessageIterator {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only part that has been changed by me (the function name + note doc). The rest is the same as the original PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants