Skip to content

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
@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