-
Notifications
You must be signed in to change notification settings - Fork 3
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: cda work queue #132
base: main
Are you sure you want to change the base?
feat: cda work queue #132
Conversation
@@ -156,6 +157,8 @@ void GIVEN_brokerWithValidCredentials_WHEN_GetClientDeviceAuthToken_THEN_returns | |||
} | |||
} | |||
|
|||
// TODO: Re-enable once infrastructure supports limiting queue size | |||
@Disabled |
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.
Need to sort out how this should work moving forward
ea84697
to
3e7c8b3
Compare
Unit Tests Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against d264ae1 |
public final class InfrastructureConfiguration { | ||
public static final int DEFAULT_WORK_QUEUE_DEPTH = 100; | ||
public static final int DEFAULT_THREAD_POOL_SIZE = 1; | ||
|
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 don't love this configuration - might make sense to re-organize a bit. But for now, we'll keep it how it is.
Note: I didn't want to change the existing SessionConfig, so this performance key is split between the two config classes. I don't love it, but I also wanted to keep this PR as contained as possible.
public void shutdown() { | ||
executor.shutdown(); | ||
} | ||
|
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'll like add methods for scheduling tasks in the future. We'll need to replace the queue with a delay queue for that. That can come later
Issue #, if available:
Description of changes:
[WIP] Introduces work queue as infrastructure. This can be injected to other classes and used to queue async jobs
Why is this change necessary:
This simplifies queuing of work that must happen in another thread context. It also enables scheduling jobs in the future.
How was this change tested:
Any additional information or context required to review the change:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.