a:16:{s:9:"#provides";s:21:"dojox.timing.Streamer";s:9:"#resource";s:18:"timing/Streamer.js";s:9:"#requires";a:1:{i:0;a:2:{i:0;s:6:"common";i:1;s:18:"dojox.timing._base";}}s:21:"dojox.timing.Streamer";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:5:{s:5:"input";a:1:{s:4:"type";s:8:"function";}s:6:"output";a:1:{s:4:"type";s:8:"function";}s:8:"interval";a:1:{s:4:"type";s:3:"int";}s:7:"minimum";a:1:{s:4:"type";s:3:"int";}s:11:"initialData";a:1:{s:4:"type";s:5:"array";}}s:6:"source";s:2514:"dojo.provide("dojox.timing.Streamer"); dojo.require("dojox.timing._base"); dojox.timing.Streamer = function( /* function */input, /* function */output, /* int */interval, /* int */minimum, /* array */initialData ){ // summary // Streamer will take an input function that pushes N datapoints into a // queue, and will pass the next point in that queue out to an // output function at the passed interval; this way you can emulate // a constant buffered stream of data. // input: the function executed when the internal queue reaches minimumSize // output: the function executed on internal tick // interval: the interval in ms at which the output function is fired. // minimum: the minimum number of elements in the internal queue. var self = this; var queue = []; // public properties this.interval = interval || 1000; this.minimumSize = minimum || 10; // latency usually == interval * minimumSize this.inputFunction = input || function(q){ }; this.outputFunction = output || function(point){ }; // more setup var timer = new dojox.timing.Timer(this.interval); var tick = function(){ self.onTick(self); if(queue.length < self.minimumSize){ self.inputFunction(queue); } var obj = queue.shift(); while(typeof(obj) == "undefined" && queue.length > 0){ obj = queue.shift(); } // check to see if the input function needs to be fired // stop before firing the output function // TODO: relegate this to the output function? if(typeof(obj) == "undefined"){ self.stop(); return; } // call the output function. self.outputFunction(obj); }; this.setInterval = function(/* int */ms){ // summary // sets the interval in milliseconds of the internal timer this.interval = ms; timer.setInterval(ms); }; this.onTick = function(/* dojox.timing.Streamer */obj){ }; // wrap the timer functions so that we can connect to them if needed. this.start = function(){ // summary // starts the Streamer if(typeof(this.inputFunction) == "function" && typeof(this.outputFunction) == "function"){ timer.start(); return; } throw new Error("You cannot start a Streamer without an input and an output function."); }; this.onStart = function(){ }; this.stop = function(){ // summary // stops the Streamer timer.stop(); }; this.onStop = function(){ }; // finish initialization timer.onTick = this.tick; timer.onStart = this.onStart; timer.onStop = this.onStop; if(initialData){ queue.concat(initialData); }";s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:30:"dojox.timing.Streamer.interval";a:2:{s:8:"instance";s:21:"dojox.timing.Streamer";s:7:"summary";s:0:"";}s:33:"dojox.timing.Streamer.minimumSize";a:2:{s:8:"instance";s:21:"dojox.timing.Streamer";s:7:"summary";s:0:"";}s:35:"dojox.timing.Streamer.inputFunction";a:2:{s:8:"instance";s:21:"dojox.timing.Streamer";s:7:"summary";s:0:"";}s:36:"dojox.timing.Streamer.outputFunction";a:2:{s:8:"instance";s:21:"dojox.timing.Streamer";s:7:"summary";s:0:"";}s:33:"dojox.timing.Streamer.setInterval";a:5:{s:8:"instance";s:21:"dojox.timing.Streamer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:2:"ms";a:1:{s:4:"type";s:3:"int";}}s:6:"source";s:1784:"dojo.provide("dojox.timing.Streamer"); dojo.require("dojox.timing._base"); dojox.timing.Streamer = function( /* function */input, /* function */output, /* int */interval, /* int */minimum, /* array */initialData ){ // summary // Streamer will take an input function that pushes N datapoints into a // queue, and will pass the next point in that queue out to an // output function at the passed interval; this way you can emulate // a constant buffered stream of data. // input: the function executed when the internal queue reaches minimumSize // output: the function executed on internal tick // interval: the interval in ms at which the output function is fired. // minimum: the minimum number of elements in the internal queue. var self = this; var queue = []; // public properties this.interval = interval || 1000; this.minimumSize = minimum || 10; // latency usually == interval * minimumSize this.inputFunction = input || function(q){ }; this.outputFunction = output || function(point){ }; // more setup var timer = new dojox.timing.Timer(this.interval); var tick = function(){ self.onTick(self); if(queue.length < self.minimumSize){ self.inputFunction(queue); } var obj = queue.shift(); while(typeof(obj) == "undefined" && queue.length > 0){ obj = queue.shift(); } // check to see if the input function needs to be fired // stop before firing the output function // TODO: relegate this to the output function? if(typeof(obj) == "undefined"){ self.stop(); return; } // call the output function. self.outputFunction(obj); }; this.setInterval = function(/* int */ms){ // summary // sets the interval in milliseconds of the internal timer this.interval = ms; timer.setInterval(ms);";s:7:"summary";s:0:"";}s:28:"dojox.timing.Streamer.onTick";a:5:{s:8:"instance";s:21:"dojox.timing.Streamer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"obj";a:1:{s:4:"type";s:21:"dojox.timing.Streamer";}}s:6:"source";s:4:" } ";s:7:"summary";s:0:"";}s:27:"dojox.timing.Streamer.start";a:4:{s:8:"instance";s:21:"dojox.timing.Streamer";s:4:"type";s:8:"Function";s:6:"source";s:2202:"dojo.provide("dojox.timing.Streamer"); dojo.require("dojox.timing._base"); dojox.timing.Streamer = function( /* function */input, /* function */output, /* int */interval, /* int */minimum, /* array */initialData ){ // summary // Streamer will take an input function that pushes N datapoints into a // queue, and will pass the next point in that queue out to an // output function at the passed interval; this way you can emulate // a constant buffered stream of data. // input: the function executed when the internal queue reaches minimumSize // output: the function executed on internal tick // interval: the interval in ms at which the output function is fired. // minimum: the minimum number of elements in the internal queue. var self = this; var queue = []; // public properties this.interval = interval || 1000; this.minimumSize = minimum || 10; // latency usually == interval * minimumSize this.inputFunction = input || function(q){ }; this.outputFunction = output || function(point){ }; // more setup var timer = new dojox.timing.Timer(this.interval); var tick = function(){ self.onTick(self); if(queue.length < self.minimumSize){ self.inputFunction(queue); } var obj = queue.shift(); while(typeof(obj) == "undefined" && queue.length > 0){ obj = queue.shift(); } // check to see if the input function needs to be fired // stop before firing the output function // TODO: relegate this to the output function? if(typeof(obj) == "undefined"){ self.stop(); return; } // call the output function. self.outputFunction(obj); }; this.setInterval = function(/* int */ms){ // summary // sets the interval in milliseconds of the internal timer this.interval = ms; timer.setInterval(ms); }; this.onTick = function(/* dojox.timing.Streamer */obj){ }; // wrap the timer functions so that we can connect to them if needed. this.start = function(){ // summary // starts the Streamer if(typeof(this.inputFunction) == "function" && typeof(this.outputFunction) == "function"){ timer.start(); return; } throw new Error("You cannot start a Streamer without an input and an output function.");";s:7:"summary";s:0:"";}s:29:"dojox.timing.Streamer.onStart";a:4:{s:8:"instance";s:21:"dojox.timing.Streamer";s:4:"type";s:8:"Function";s:6:"source";s:4:" } ";s:7:"summary";s:0:"";}s:26:"dojox.timing.Streamer.stop";a:4:{s:8:"instance";s:21:"dojox.timing.Streamer";s:4:"type";s:8:"Function";s:6:"source";s:2315:"dojo.provide("dojox.timing.Streamer"); dojo.require("dojox.timing._base"); dojox.timing.Streamer = function( /* function */input, /* function */output, /* int */interval, /* int */minimum, /* array */initialData ){ // summary // Streamer will take an input function that pushes N datapoints into a // queue, and will pass the next point in that queue out to an // output function at the passed interval; this way you can emulate // a constant buffered stream of data. // input: the function executed when the internal queue reaches minimumSize // output: the function executed on internal tick // interval: the interval in ms at which the output function is fired. // minimum: the minimum number of elements in the internal queue. var self = this; var queue = []; // public properties this.interval = interval || 1000; this.minimumSize = minimum || 10; // latency usually == interval * minimumSize this.inputFunction = input || function(q){ }; this.outputFunction = output || function(point){ }; // more setup var timer = new dojox.timing.Timer(this.interval); var tick = function(){ self.onTick(self); if(queue.length < self.minimumSize){ self.inputFunction(queue); } var obj = queue.shift(); while(typeof(obj) == "undefined" && queue.length > 0){ obj = queue.shift(); } // check to see if the input function needs to be fired // stop before firing the output function // TODO: relegate this to the output function? if(typeof(obj) == "undefined"){ self.stop(); return; } // call the output function. self.outputFunction(obj); }; this.setInterval = function(/* int */ms){ // summary // sets the interval in milliseconds of the internal timer this.interval = ms; timer.setInterval(ms); }; this.onTick = function(/* dojox.timing.Streamer */obj){ }; // wrap the timer functions so that we can connect to them if needed. this.start = function(){ // summary // starts the Streamer if(typeof(this.inputFunction) == "function" && typeof(this.outputFunction) == "function"){ timer.start(); return; } throw new Error("You cannot start a Streamer without an input and an output function."); }; this.onStart = function(){ }; this.stop = function(){ // summary // stops the Streamer timer.stop();";s:7:"summary";s:0:"";}s:28:"dojox.timing.Streamer.onStop";a:4:{s:8:"instance";s:21:"dojox.timing.Streamer";s:4:"type";s:8:"Function";s:6:"source";s:4:" } ";s:7:"summary";s:0:"";}s:12:"dojox.timing";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}