Skip to content

Conversation

@reda-alaoui
Copy link
Contributor

No description provided.

@reda-alaoui reda-alaoui force-pushed the scheduler-thread-factory branch from beee88b to 05dc246 Compare August 12, 2024 14:22
@badgerwithagun
Copy link
Member

I think this would be more neatly solved by as noted on #687 by allowing a ScheduledExecutorService to be supplied when building the TransactionOutbox. You should have the option to be entirely control of your executor lifetimes rather than expecting the outbox to do it.

@reda-alaoui
Copy link
Contributor Author

reda-alaoui commented Aug 21, 2024

@badgerwithagun , by default, TransactionOutbox#scheduler uses a single thread pool. I thought this was important to keep this number of threads to avoid potential concurrency issues. Letting applications pass a full executor instead of a ThreadFactory will allow the formers to provide multi threaded executors.

If you think there is no concurrency issue with an executor holding more than 1 thread, we could consider there is resource waste issue and/or an API surface that is too wide if 1 thread is strictly enough.

Let me know what you think of that :)

@badgerwithagun
Copy link
Member

badgerwithagun commented Aug 26, 2024

@reda-alaoui I'm fine with the JAvadoc just making it clear that the ScheduledExecutorService should only have one executing thread and queue concurrent requests. By default it will use the existing implementation which works fine. If a user starts messing around with it, they should know what they are doing!

Copy link
Member

@badgerwithagun badgerwithagun left a comment

Choose a reason for hiding this comment

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

.

@badgerwithagun
Copy link
Member

Closing due to lack of activity

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