Comments (4)
I will fix this footgun in user-land. (-__-)
from equinox.
Async.Parallel
and AwaitTaskCorrect
will never leave an orphan task running.
I can't recall which dotnet/fsharp
issue covers this, but the problem here is not AwaitTaskCorrect
- it's the fact that the Delay
you are invoking is working as spec'd -- delaying forever. Async.Sleep
, on the other hand, internally honors cancellation (because it can, via Async.CancellationToken
).
Thus I'd claim this is an invalid case - if you replace B with
let B = async {
let! ct = Async.CancellationToken
return! Task.Delay(Timeout.Infinite, cancellationToken = ct) |> Async.AwaitTaskCorrect
}
I'm pretty sure Async.AwaitTask
shares the same semantics.
from equinox.
Yes, Async.AwaitTask
shares the same semantics. Which is why I'd expect AwaitTaskCorrect
to improve on the semantics.
It's same story for something based on anything based on TaskCompletionSource.
from equinox.
Leaking unawaited Task
s on every cancellation is an acquired taste; I'd be on the side of preferring the determinism at all costs.
Things like Task.AwaitAll
don't do such things
Yes, there is an argument that this can be painful in practice - e.g. like the .NET 4.0 crashing the process if a Task is unobserved, but I think the issues in dotnet/fsharp
have traversed this territory far better than we'll ever do here (some are still open - it's definitely not an open and shut thing)
Bottom line in the context of the github/jet
repos is that they're all designed to play well with these semantics, e.g. https://github.com/jet/propulsion/blob/master/src/Propulsion/Internal.fs#L68
from equinox.
Related Issues (20)
- V2: constrain dependencies HOT 1
- V2: Cosmos: Backport LogSink signature change HOT 2
- QUESTION: How do you support regulatory requirements to purge persisted Personally Data (e.g. GDPR)? HOT 4
- Cosmos Table support HOT 2
- Cosmos: Fix unfold event numbering
- Add LoadOption.RequireLeader
- missed published packages HOT 6
- StreamId.gen2/3 - consider revert to struct tuples HOT 1
- StreamNotFoundException when trying to add Events to a new Stream with EventStoreDb HOT 5
- Is there a specific message-db version that one has to use? HOT 8
- DynamoDB: EventsContext fails to read when tip not read HOT 1
- Feature: ReadThrough mode HOT 1
- DynamoStore: Needs to write through tip to guarantee order on DDB streams
- Core: NullReferenceException when using cached reads
- DynamoStore: Use ReturnValuesOnConditionCheckFailure to implement Resync
- refactor: Label contexts unambiguously
- Rename AsyncCacheCell to TaskCell
- CosmosStore: Complain about large partition keys if not configured
- Remove Compaction from Domain terms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from equinox.