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

Flag to return messages received so far when maxWait is reached #313

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

bittrance
Copy link
Contributor

@bittrance bittrance commented Dec 3, 2024

The current behavior, to panic on deadline is problematic, since there are a number of scenarios where you simply do not know how many messages there are to consume or when they are produced. For example, a load test may produce messages in bursts with jitter for a burn-in test, to try to provoke i data races in the test subject.

This commit introduces a flag ExpectTimeout which will return message received so far.

The commit also adds a test to verify that we panic if Close() is called while we are consuming. Given the nature of the problem xk6-kafka is trying to solve, this sounds like an error condition.

Fixes #311.

The current behavior, to panic on deadline is problematic, since
there are a number of scenarios where you simply do not know how
many messages there are to consume or when they are produced. For
example, a load test may produce messages in bursts with jitter
for a burn-in test, to try to provoke i data races in the test
subject.

This commit introduces a flag ExpectTimeout which will return message
received so far.

The commit also adds a test to verify that we panic if Close() is
called while we are consuming. Given the nature of the problem
xk6-kafka is trying to solve, this sounds like an errar condition.
@bittrance
Copy link
Contributor Author

Hm, how do I update the api-docs? They look auto-generated?

@mostafa
Copy link
Owner

mostafa commented Dec 4, 2024

@bittrance Update index.d.ts and then run the following in sequence, considering you have node, yarn and node_modules installed:

yarn run validate-d-ts
yarn run generate-docs
yarn run prettify

Copy link

sonarcloud bot commented Dec 4, 2024

@mostafa mostafa merged commit 2c5d328 into mostafa:main Dec 4, 2024
4 checks passed
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.

Is Reader.consume() supposed to throw on underflow?
2 participants