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

feat(nats-connection): implement named executor thread factories #1254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krzysiekigry
Copy link

goodbye, "pool-2-thread-1"

@scottf
Copy link
Contributor

scottf commented Nov 21, 2024

@krzysiekigry So the idea is fine, but it needs to be done in an optional way, since someone might currently rely on that naming scheme in their existing application / logs.

In the Options Builder, you can call public Builder executor(ExecutorService executor), so maybe add these:

public Builder callbackExecutor(ExecutorService executor) 
public Builder connectExecutor(ExecutorService executor) 

With the defaults matching exactly the existing i.e. newSingleThreadExecutor()

And so starting at line 159 of NatsConnection, that block of code would look like this:

this.executor = options.getExecutor();
this.callbackRunner = options.getCallbackExecutor();
this.connectExecutor = options.getConnectExecutor();

Also, please sign your commits. Here is a good link to help with that: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

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