Skip to content
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

Add commitCb method #15

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Conversation

emasab
Copy link
Contributor

@emasab emasab commented Dec 11, 2023

to avoid blocking while committing
and return a Promise without having
to call consume()

to avoid blocking while committing
and return a Promise without having
to call consumer
@emasab emasab requested a review from a team as a code owner December 11, 2023 19:11
Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

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

Looks OK beside a minor comment

@@ -326,24 +326,32 @@ class Consumer {
* @param {import("../../types/kafkajs").TopicPartitionOffsetAndMetadata[]?} topicPartitions
* @returns {Promise<void>} a promise that resolves when the offsets have been committed.
*/
async commitOffsets(topicPartitions = null) {
commitOffsets(topicPartitions = null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep it async to meet the kafkajs API, and it'll work since we're returning a promise anyway

@emasab emasab merged commit 3f1190f into feature/add-consumer-errors Dec 12, 2023
0 of 2 checks passed
@emasab emasab deleted the feature/commit-cb branch December 12, 2023 08:42
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