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

[1.x] Allow supplying Executor for SystemWriteSide #1448

Merged
merged 10 commits into from
Apr 20, 2022

Conversation

yevhenii-nadtochii
Copy link
Contributor

@yevhenii-nadtochii yevhenii-nadtochii commented Apr 19, 2022

This PR addresses #1275.

Now, SystemSettings allows customizing an Executor which is used to post the system events in parallel. This provides an opportunity to improve the control over the available CPU resources on a server instance.

An example usage:

var builder = BoundedContextBuilder.assumingTests();
var executor = ...;

builder.systemSettings()
    .enableParallelPosting()
    .useCustomExecutor(executor);

The issue asked for ExecutorService that is extended version of Executor. But in the scope of SystemWriteSide and its single implementation DefaultSystemWriteSide, we can do with just Executor as no methods beside execute(Runnable) are used.

The library version is bumped to 1.8.2.-SNAPSHOT.1.

@yevhenii-nadtochii yevhenii-nadtochii self-assigned this Apr 19, 2022
@yevhenii-nadtochii yevhenii-nadtochii marked this pull request as ready for review April 19, 2022 16:19
@yevhenii-nadtochii
Copy link
Contributor Author

@armiol Please take a look.

Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

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

LGTM with some minor comments to address.

@yevhenii-nadtochii yevhenii-nadtochii merged commit bb32296 into 1.x-dev Apr 20, 2022
@yevhenii-nadtochii yevhenii-nadtochii deleted the custom-executor branch April 20, 2022 09:39
@yevhenii-nadtochii yevhenii-nadtochii linked an issue Apr 20, 2022 that may be closed by this pull request
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.

Allow supplying ExecutorService for SystemWriteSide
2 participants