YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  • Home
  • Gallery
  • Forums
  • YUI 2
  • YUI 3
  • YUICompressor
  • YUIDoc
  • More
  • Gallery Forums
  • Gallery Stats
  • Gallery Calendar
  • Register
  • Login

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    IO Poller (gallery-io-poller)

    Last Updated: 12/31/09
    + 0 -

    Eric Ferraiuolo

    YUI Contributor

    See 4 more by this user.

    Created: 10/29/09
    Last CDN Push: 11/19/09
    Build Tag: gallery-2009.11.19-20
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.0.0
    Free for use.

    Use just like regular Y.io, but the first parameter is the number of milliseconds to continually xhr-poll at. A new callback method/event has been added, 'modified', which will only be called when the server resource sends a 200 OK response.

    The IO config object (third parameter to Y.io.poll) is just like, Y.io's config object; but a new on: { modified: function(txId, r, args){ /* your callback code here */ } } callback/event is added.

    This will smartly poll the server using conditional GET requests (when method is set to GET).

    Blog post on smart polling: http://925html.com/code/smart-polling/

    • Tags:
    • ericf
    • io
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Code Sample

    YUI({
        modules: {
            'gallery-io-poller': {
                fullpath: 'http://yui.yahooapis.com/gallery-2009.11.19-20/build/gallery-io-poller/gallery-io-poller-min.js',
                requires: ['io-base','base-base'],
                optional: [],
                supersedes: []
          }
     
        }
    }).use('gallery-io-poller', function(Y) {
     
    	var resource = Y.io.poll(5000, 'path/to/resource/', {
    		on : {
    			modified : function (txId, r, args) {
     
    				// the resource has been modified
     
    			}
    		}
    	});
    	resource.start();
     
    });

    Forum Posts

    No forum posts for this module.

    YUI Projects
    • All YUI Downloads
    • YUI 2
    • YUI 3
    • YUIDoc
    • YUICompressor
    • YUILibrary.com
    • YUI Build Tool
    • YUI PHP Loader
    Pages & Links
    • All YUI Downloads
    • Git FAQ
    • Graded Browser Support
    • Contribute to YUI
    • Forum Stats
    • Gallery Stats
    • YUI Calendar
    Contribute
    • Submit a Bug
    • Request a Feature
    • Write Code
    • Meet the Team
    Follow YUI
    • on GitHub
    • on Twitter
    • on FriendFeed
    • on Facebook
    • on IRC
    • YUI Blog
    • YUI Theater
    • YUI Forums

    © 2010 YUI Library - Site Credits