-
Notifications
You must be signed in to change notification settings - Fork 529
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
Introduce an unyielding { ... }
construct
#2610
Comments
I think it would probably also suppress regular cedes. So something like: unyielding(cede) <-> unyielding(unit) |
Also maybe |
|
|
It this the same idea as |
Nice catch! Yes it is. |
Another thought about this ... in JS land, can't we very nearly cheat with: def undecedable[A](fa: F[A]) = evalOn(fa, JSExecutionContext.queue) |
Is that the promises-based one? If so then yes, that would basically work. :-P |
Yeah 😆 for this to work it assumes that you are currently on some macrotask-based executor. But the thing is, all the instances that I've wanted So this would exactly achieve that semantic without requiring any changes from implementers. I think this should do just fine for JS. |
Forgot to add some notes from another recent discussion on this. Specifically, what to do about: IO.undecedable(IO.sleep(...)) or I think an important distinction to make here is that when you are reaching for In code you 100% control, you can avoid those problem combinators the only rescheduling to worry about is auto- The See also the definition of |
After writing all of that 😂 maybe the best we can do (and we can do today, without breaking compat!) is introduce a new API on |
I'm wondering if a |
Interesting idea, but I'm not sure. In this case, I don't think there is really a branch (unless I missed your point :). Either way in the end, you end up with |
I don't know... yes, if you want no rescheduling, you probably absolutely need it. So you're probably right. |
I understand |
Hmm you are right! |
Spinning out of #2478 (comment). tl;dr, a way to prevent (auto?) cedes/yields for a region of the program.
The text was updated successfully, but these errors were encountered: