8000 Remove Blocking From The Environment by adamgfraser · Pull Request #5080 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove Blocking From The Environment #5080

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

Merged
merged 8 commits into from
May 17, 2021
Merged

Remove Blocking From The Environment #5080

merged 8 commits into from
May 17, 2021

Conversation

adamgfraser
Copy link
Contributor
@adamgfraser adamgfraser commented May 13, 2021

Resolves #5076.

Removes the Blocking service from the environment. Blocking is now managed by a collection of operators that lock the effect to an Executor backed by a blocking thread pool. Right now this is just a global blocking thread pool but we could potentially allow each fiber to have a blocking executor as well as a normal executor associated with it. Then we could provide a variant of shift that allowed setting that blocking executor to a new value. This would allow setting the blocking executor to a new value within a scope.

8000
@adamgfraser adamgfraser requested a review from iravid as a code owner May 13, 2021 19:11
@adamgfraser adamgfraser requested a review from jdegoes May 14, 2021 21:28
// Reference user's lambda for the tracer
ZIOFn.recordTrace(() => effect) {
ZIO.effectSuspendTotal {
import java.util.concurrent.atomic.AtomicReference
Copy link
Member

Choose a reason for hiding this comment

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

Is this fine in shared?

Copy link
Member

Choose a reason for hiding this comment

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


object Blocking {

val blockingExecutor: Executor =
Copy link
Member

Choose a reason for hiding this comment

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

lazy val perhaps

Copy link
Member
@jdegoes jdegoes left a comment

Choose a reason for hiding this comment

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

Excellent work! Going to clean things up for a lot of use cases.

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.

3 participants
0