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

Allow global thread and process pool executors #106

Open
suned opened this issue May 18, 2022 · 0 comments
Open

Allow global thread and process pool executors #106

suned opened this issue May 18, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@suned
Copy link
Owner

suned commented May 18, 2022

Currently each effect is interpreted using its own process and thread pools. It would be preferable to enable the caller to control the lifecycle of these pools. Concretely, we could change the signature of functions that introduce the dependency on a thread or process pool to e.g:

def from_cpu_bound_callable(f: Callable[[R], Either[E, A]]) -> Effect[Intersection[R, HasProcessPool], E, A]: ...

Where HasProcessPool is defined as:

from typing import Protocol


class HasProcessPool(Protocol):
    pool: ProcessPoolExecutor
@suned suned added the enhancement New feature or request label May 18, 2022
@suned suned added this to the Release version 1.0.0 milestone May 18, 2022
@suned suned self-assigned this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant