-
Notifications
You must be signed in to change notification settings - Fork 339
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
feat: adding concurrency functionality #562
base: canary
Are you sure you want to change the base?
Conversation
LCOV of commit
|
private heartbeatInterval: number; | ||
private isPolling = false; | ||
private stopRequestedAtTimestamp: number; | ||
public abortController: AbortController; | ||
private extendedAWSErrors: boolean; | ||
private concurrency: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want a maxConcurrency setting that ensures we're not trying to do silly stuff.
} | ||
waitingMessages++; | ||
await new Promise((resolve) => | ||
setTimeout(resolve, this.concurrencyWaitTimeMs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to think if concurrencyWaitTimeMs
, it's probably too late and my brain is mush at this point though, but I think this conflicts with the polling timeout? Need to think on it.
try { | ||
await this.processMessage(message); | ||
} finally { | ||
this.inFlightMessages--; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if it could poll again to maintain maximum concurrency.
This PR looks to add concurrency functionality.
Many users have asked for this in the past, I think this implements it in a decent way that doesn't need any external dependencies and should maintain backwards compatiblity.
There is potential that this might cause breaking issues though, so we should release this as breaking even though it might not be.