/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 3.0.0 build: 1549 */ YUI.add('datasource-polling', function(Y) { /** * Extends DataSource with polling functionality. * * @module datasource * @submodule datasource-polling */ /** * Adds polling to the DataSource Utility. * @class Pollable * @extends DataSource.Local */ var LANG = Y.Lang, Pollable = function() { this._intervals = {}; }; Pollable.prototype = { /** * @property _intervals * @description Hash of polling interval IDs that have been enabled, * stored here to be able to clear all intervals. * @private */ _intervals: null, /** * Sets up a polling mechanism to send requests at set intervals and forward * responses to given callback. * * @method setInterval * @param msec {Number} Length of interval in milliseconds. * @param request {Object} Request object. * @param callback {Object} An object literal with the following properties: *
success
failure
argument