+
+ Timeout.add_full(Priority.LOW, 1000, () => {
+
+ //print("TIMEOUT queue length = %d, is_runing = %s\n", (int)this.queue.length , this.queueRunning ? "Y" : "N");
+
+ //stdout.printf("QL %u: QR: %d\n", this.queue.length, this.queueRunning ? 1 : 0);
+ if (this.queue.length < 1 || this.queueRunning) {
+ return true;
+ }
+
+ var last = -1 * this.lastAdd.difference(new DateTime.now(new TimeZone.local()));
+
+ // stdout.printf("LAST RUN: %s (expect %s) \n" ,
+ // last.to_string(), (5 * TimeSpan.SECOND).to_string() );
+
+ if (last < 5 * TimeSpan.SECOND) { // wait 5 seconds before running. ????
+ return true;
+ }
+ //_this.lastAdd = new Date();
+ //return 1;
+
+ this.runQueue();
+ return true; //
+ });
+
+