Skip to content

Conversation

@jakubjanecek
Copy link
Collaborator

feat: Make blocking thread pool executor configurable

Closes #593

feat: Make blocking thread pool executor configurable

Closes #593
def makeDefault[F[_]: Sync]: Resource[F, ExecutorModule[F]] = {
for {
numOfCpus <- Resource.eval(Sync[F].delay(Runtime.getRuntime.availableProcessors))
coreSize = numOfCpus * 2
Copy link
Contributor

@sideeffffect sideeffffect Jun 23, 2021

Choose a reason for hiding this comment

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

Btw, I think that this is a bit questionable, but that is for a different debate.

I think you've already seen this before 😸
https://twitter.com/impurepics/status/987758585722621957?lang=en
and
https://github.com/ChristopherDavenport/linebacker

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The theory is that num of CPUs is the right number but in practice (and I've seen this discussed somewhere long in the past) is that a bit higher number might work better. And I think I also got inspired in ZIO runtime. Anyway, I don't think there's much difference so if you show me at least some examples or documents (not just one image ;) ) I think we could change it.

@mergify mergify bot merged commit 35014b5 into master Jun 23, 2021
@mergify mergify bot deleted the fix/593/executors branch June 23, 2021 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding configuration options for blocking executor to ExecutorModule

3 participants