4 ms·
Is concurrency supported?
by amelius 6y ago
Is concurrency supported?
- JaggerJo 6y agowhat exactly do you mean by ‘concurrency’ ? F#’s async workflows are supported. Not sure how this is implemented behind the covers - I guess it get’s compiled to JS promises.
- amelius 6y ago> what exactly do you mean by ‘concurrency’ ? Good point. I guess I meant parallelism instead. https://stackoverflow.com/questions/1050222/what-is-the-difference-between-concurrency-and-parallelism https://stackoverflow.com/questions/1050222/what-is-the-diff...
- JaggerJo 6y agoNot supported IIRC as it’s not supported by JavaScript. I think it can still be archived with web workers.
- angio 6y agoAs already mentioned, you can use web workers. Feliz (a React library for F#) provides a nice way to use them [0]. [0] https://zaid-ajaj.github.io/Feliz/#/Hooks/UseWorker https://zaid-ajaj.github.io/Feliz/#/Hooks/UseWorker
- nbevans 6y agoYes - F# provides its own async model via an `async` computation expression. But you can also use the TPL in .NET BCL. F# 6 will have native support for TPL via a `task` computation expression. But honestly, its own async model is great - arguably better than TPL for business systems. It sacrifices a little top-end performance/power and in return you get a supremely clean abstraction.