-
Notifications
You must be signed in to change notification settings - Fork 521
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
Incorrect Async scaladoc #3199
Comments
I've been confused about this before. For some reason I was under the impression that Edit: fwiw, at least to me it really seemed like it should be uncancelable by default unless explicitly made cancelable. |
Oh really? I thought basically everything was "cancelable by default"? The only exception I can think of is |
There's a subtler point at play here as well. You can think of Neither lets you cancel the registration, that's what the new
If you're referring to the "waiting", that's not the CE default, and also pretty weird for something async to be uncancelable. If you're referring to the "registration", what you describe is already what happens |
Yes, this. It feels very strange to me that you can cancel an async effect and move on without actually interrupting it. This seems very wrong, and as far as I know is the only place where these concepts are disconnected: everywhere else, cancellation means the fiber is interrupted and there is backpressure until it has done so. |
Honestly, I see where you're coming from (in my previous message I hadn't realised you meant |
It's a question, but I'm not sure if it is the question 😛 I think my main observations are:
All in all, it's really hard not to feel like it's a bug that |
This is a really interesting point. When I originally wrote You can extend this argument further though, since even when you provide a finalizer using |
Sure, but IMHO that's only because of bullshit APIs in-between. My work on fs2-io_uring convinces me that if we start from the primitives we can do this Right™. In any case, regardless of what most people may do, I'm staring at this. cats-effect/kernel/shared/src/main/scala/cats/effect/kernel/Async.scala Lines 158 to 161 in 5ba5543
and at this: cats-effect/kernel/js/src/main/scala/cats/effect/kernel/AsyncPlatform.scala Lines 25 to 27 in 5ba5543
Even if we are not going to fix |
I think historically, |
Rereading the whole thread though, I think I actually agree with Arman |
Does anybody have any good intuition about what would happen if we just… flipped the switch? Specifically, making |
If you think the |
Oh this would definitely need a dedicated RC cycle and a lot of communication. It's out for 3.4. Also just playing around with it quickly on a branch, it breaks Cats Effect itself. Probably just a bunch of bad assumptions in a few places, but it's illustrative that even in CE itself we are leaning on this semantic. |
Now that #3205 is merged I believe the scaladoc is correct, at least on the |
I think the
Async
scaladoc contains incorrect information since #3002 was merged. I've already commented on that PR about this issue, but the problem is basically that (contrary to its scaladoc)async_
does not return an uncancelable effect (and I don't think it's intended to, i.e., the scaladoc is mistaken):And similary for
async
when it returnsNone
. (The note aboutasync
being uncancelable during its registration is correct, as far as I can tell.)The text was updated successfully, but these errors were encountered: