[flocking-users] console log behaviour

Colin Clark colin at colinclark.org
Sat Jan 10 11:51:51 EST 2015


Hi Antonio,

Yes, this is a known issue. Since you created your own Scheduler instance, the Playground doesn't know that it exists, so it can't stop it when you press the pause button. My plans for Flocking 0.2.0 will address this limitation in various ways.

However, the Flocking environment has a default scheduler that is available for this purpose, and it will be automatically cleared each time you pause the Playground. You can access it like this:

var clock = flock.enviro.shared.asyncScheduler;

If you modify your code to use the environment's scheduler, you should see that your console logs stop when you pause the Playground.

Colin

> On Jan 10, 2015, at 9:44 AM, Antonio Della Marina <antonio.dellamarina at gmail.com> wrote:
> 
> Hello again :)
> 
> different topic, different message:
> I put this code in the playground:
> 
> var clock = flock.scheduler.async.tempo({
>        bpm: 60
> });
> 
> 
> clock.repeat(1, function () {
>    console.log("whatever");
> });
> 
> the console keeps throwing the output even when I stop the player and I run a different script. 
> Moreover if I run again the code it gives the output twice etc. Only when I quit Chrome it stops.
> 
> Is it normal?




More information about the flocking mailing list