Replies: 1 comment
-
|
Hello, Sorry I don't have enough knowledge regarding If it helps, the implementation of You can use this file and Fable REPL to see how the code is translated. Note: I know that in general F# people prefer to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As a day-to-day Fable user, I’d like to confirm how
Async<'a>is intended to behave on the JavaScript runtime (in Fable), and propose adding a short doc page if the current behavior is considered the spec.In .NET,
Async<'a>describes an asynchronous computation independent of how it’s executed (not tied to threads). On JS we have a single-threaded event loop with a microtask queue and a macrotask queue, which makes it easy to get confused about what runs where.What I’m trying to confirm
let!/do!, which queue runs the continuation on JS?Async.Sleep msis scheduled (macrotask?).Asyncworkflow withrequestAnimationFrame.RunSynchronously, no true multithreading, etc.).My current mental model (please correct if wrong)
let!/do!behave like a Promise.thenchain, so continuations run as microtasks.Async.Sleep msuses a timer (e.g.,setTimeout), so it resumes as a macrotask.requestAnimationFramematters; there’s no built-inAsyncprimitive for it.Why this would help
Asyncon JS (useful for both users and contributors)Beta Was this translation helpful? Give feedback.
All reactions