Brian, The callback (C) is going to be invoked on the main thread (A), but everything else sounds good to me. There's a decent explanation here http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/ which I think generalises to other/similar runtimes.
Take care, Moe On Mon, Aug 8, 2016 at 12:27 PM, Brian Beckman <[email protected]> wrote: > On Monday, August 8, 2016 at 6:30:14 AM UTC-7, Moe Aboulkheir wrote: > > By no means is it typical that in a JS runtime, external interactions > (I/O) would block the execution thread - if that were the case, the > callbacks would not be necessary. > > > > > > Take care, > > Moe > > Let's see whether I understand: The code running on the JavaScript main > thread (call it A) makes a non-blocking call to a service (say I/O, call > its code B) and passes in a callback C written by me. The call to B returns > immediately and my main JavaScript code A continues doing whatever it was > doing (say servicing the user interface). The callback code C executes on > _another_ thread, a thread under control of the B. I write code A and I > write code C, but my code A runs on the JavaScript main thread and my code > C runs on some other thread. Is that right? > > -- > Note that posts from new members are moderated - please be patient with > your first post. > --- > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/clojurescript. > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
