rwaldron / temporal

Non-blocking, temporal task sequencing. For use with robots built with Johnny-Five
http://johnny-five.io/
MIT License
84 stars 12 forks source link

Inner queue is not executed on nested queue in loop. #11

Closed mpbod closed 9 years ago

mpbod commented 9 years ago
  temporal.loop(4000, function() {
    temporal.queue([
      {
        delay: 150,
        task: function() {
          display.draw("-");
        }
      },
      {
        delay: 150,
        task: function() {
          display.draw("^");
        }
      }
    ]);
  });

Nesting like this does not execute the queue inside. Is there another way to execute this? Thanks :)

mpbod commented 9 years ago

Achieved with this.

temporal.loop(4000, function() {
    board.display.draw("O");
    temporal.delay(150, function(){ board.display.draw("-")});
    temporal.delay(300, function(){ board.display.draw("O")});
    temporal.delay(450, function(){ board.display.draw("-")});
    temporal.delay(600, function(){ board.display.draw("O")});
  });

Closing the issue.