8000 Fix `Runtime#unsafe.fork` and `Runtime#unsafe.runToFuture` by kyri-petrou · Pull Request #8752 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Runtime#unsafe.fork and Runtime#unsafe.runToFuture #8752

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 3 commits into from
Apr 18, 2024

Conversation

kyri-petrou
Copy link
Contributor

/fixes #8751

@ghostdogpr
Copy link
Member

How about cancelFiber.start in the future case?

@kyri-petrou
Copy link
Contributor Author

How about cancelFiber.start in the future case?

interruptAs only adds a message to the running fiber's queue and then awaits asynchronously. Therefore I think we can get away with using start here and have the submission run on the calling thread

ghostdogpr
ghostdogpr previously approved these changes Apr 16, 2024
@guizmaii
Copy link
Member

Would it be possible to add a test maybe? 🤔

@kyri-petrou
Copy link
Contributor Author

Would it be possible to add a test maybe? 🤔

Done 👍

@kyri-petrou
Copy link
Contributor Author

Hmm is there anything that cross-compiles to ScalaJS that is equivalent of Thread.sleep? Otherwise I can just move the test to the JVM suite

@jdegoes jdegoes merged commit 655a2e3 into zio:series/2.x Apr 18, 2024
@kyri-petrou kyri-petrou deleted the fix-runtime-fork branch April 18, 2024 13:31
kyri-petrou added a commit that referenced this pull request Apr 19, 2024
erikvanoosten pushed a commit to erikvanoosten/zio that referenced this pull request Feb 9, 2025
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.

Runtime#unsafe.fork doesn't fork synchronous effects
5 participants
0