Allow JS to yield and allow GUI to update

Jan 22, 2013 at 12:16pm

Allow JS to yield and allow GUI to update

Hi, is there anything that can be done in a long process in js to allow the ui to run so that any updates waiting to go to the max window can be made?

Jan 24, 2013 at 9:41pm

Not implicitly. You can explicitly break your operation into multiple slices, and use the Task object to periodically call your worker function in slices. e.g. something like the following.

var current_slice=0;
var worker_task = new Task(doslice);

function startwork()

function doslice()
  // do some portion of the work here;
  if (current_slice
Jan 25, 2013 at 1:42pm

Lovely. Thanks for the info :)


You must be logged in to reply to this topic.