-
Notifications
You must be signed in to change notification settings - Fork 8
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
Remove AggregateException wrapping in Async CE for
extension and prevent threadpool transition
#129
Comments
Fringe ramblings which you may consider related: I tend to have an
Aside: the term Related: Potentially would advocate for inclusion of any |
Yes, before I wrote this extension, I wasn't aware of the issues with As with #128, we should consider placing these in a separate library. Though for the sake of this one being a no-dependency library by choice, for now we'll just implement it here (and/or copy or link it from whatever other library we conceive). |
for
semanticsfor
extension and prevent threadpool transition
Yes, the honoring of Async.CancellationToken aspect to terminate the wait is notably subtle to me and makes covering it well worthwhile.
I'm in a similar quandary with Equinox - the core lib is tiny and making it depend on another lib only for AwaitTaskCorrect feels like jumping the shark and going leftpadesque. There are 5 other libs that need both TaskSeq and AwaitTaskCorrect. But the bottom line is that having a separate lib, no matter how small, is simply the right thing to do. UNLESS/until it goes into FSharp.Core.... (see conclusion below) FsKafka is another case where the lib is a 400 line slab that has a stupid other file that dilutes that simplicity and directness thanks to AwaitTaskCorrect FSharp.AWS.DynamoDB has a copy too, and I really would like for the world to have a way of knowing that a given exe has only one set of AwaitTask semantics in play when reasoning about stack traces and the inevitably hairy cancellation and/or hang issues (see dotnet/fsharp#13165 - a large part of whittling that down was doing stupid busywork diffing to rule that sort of stuff out). (for that lib, the larger issue is that it should probably present a Having said all that, I respect the value of not having a package dependency and will likely distribute a copy of the final AwaitTaskCorrect into FSharo.AWS.DynamoDB, FsKafka, Equinox and Propulsion if that's what TaskSeq does (and will argue against making TaskSeq's version public to avoid people havign to self-discipline to not take a depedency on TaskSeq only for AwaitTaskCorrect). But I think I am saying I'm voting for |
|
Thanks for all the input, some work is cut out for me :).
Alternatively: we can take a source dependency instead. That way it can be internal.
All of AsyncSeq is potentially on the roadmap, but some design decisions there I don’t want to repeat. My first goal is to complete the ‘low hanging fruit’ roadmap, based on This gives us See also #77 for the differences. |
Ah, I missed the mention of the fact that parallelism is off the table for now in https://github.com/fsprojects/FSharp.Control.TaskSeq#further-reading-iasyncenumerable - focusing on getting stuff mapped out in the core feature set absolutely makes sense, especially given the non-trivial nature of the ancillary aspects as highlighted by this very issue. |
Just FYI: the This thread can then solely focus on the issues around |
👍 Apologies for mixing the concerns in the first instance. Putting this here as this thread has already run amok; not sure if it's really TL;DR there needs to be a canonical set of helpers somewhere that emphasize:
Below the fold, I have itemised the APIs I believe should be considered for wrapping. My hope is that we can:
|
Maybe you can copy that whole text as a new issue? It feels like it actually belongs in #128, no? Basically the whole idea of agreeing on a surface area for Task/Async, likely in its own repo and package. Maybe I should just go set one up and we can continue there? |
Forgot I own #128 🤡, that does make kinda sense. My intent was to transplant all this into a fresh issue. But I did want for us to have a brief pre-discussion about the outline surface area before spreading it widely (and re-atting Don and TheAngryByrd etc) I appreciate you're probably trying to avoid jumping straight back into this after expending lots of time and effort only yesterday, but making sure that we've both happy with the first cut before I create it afresh would be ideal, even if that means holding off for some days (it might also make sense to defer this until we (aka you) have validated that an impl of |
At present the current impl of
for
withinasync {
expressions raises two concerns for me:AwaitTaskCorrect
semantics would be preferable to promulgating usage ofAsync.AwaitTask
in a place that most people will not necessarily even infer that it's in play.Async.StartAsTask
includes an unnecessary transition to the Thread Pool (with a potential context switch?) which could instead safely be replaced withAsync.StartImmediateAsTask
in this context. EDIT: moved to separate thread #135The text was updated successfully, but these errors were encountered: