On Tuesday, August 25, 2015 at 10:59:53 AM UTC+2, Daniel Kersten wrote: > "The browser does not support threads so neither can core.async." > > > To expand on that, core.async uses cooperative multitasking, which means you > have to give control back every so often so it can schedule other go blocks > to be run. Calls like <! will do this while they block (which is why timeout > works). >
While that is correct let me emphasize that timeout is not a solution! Do you always know how long task X will run or whether you are going to need to chunk it? Is it even possible to split up? A "task" that may complete in 10ms on your machine might take 100ms on another one or even 500ms on yours if the computer is doing something else. If you need to do CPU intensive work in the browser use a WebWorker. It is their purpose. While not perfect it is far better than trying to be "cooperative" in your code. My 2 cents, /thomas -- 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 http://groups.google.com/group/clojurescript.
