Results 1 to 2 of 2

Thread: [3.x] ux.Worker/GenericWorker - HTML5 Workers for the masses.

  1. #1
    Sencha User
    Join Date
    Aug 2007
    Long Island, NY USA

    Lightbulb [3.x] ux.Worker/GenericWorker - HTML5 Workers for the masses.

    Get started using the powerful new HTML5 Worker object.

    Developed exclusively for Ext, the Ext.ux.Worker provides an Ext Observable wrapper class around this new threaded object (currently supported on recent versions of FireFox 3.1+, Chrome, and Safari).

    What about IE, though?

    Fear not, you can deploy HTML5 worker scripts on IE (or other non-HTML5-compliant browser) using the included GenericWorker object (they just won't be truly threaded).
    The ux.Worker package assigns
    window.Worker = GenericWorker
    for those browsers that do not support it natively.

    What can a Worker do?
    Frequently called "Web Workers", these scripted tasks run in a separate thread from the page context that creates them. Compute intensive tasks (heavy loops, number crunching) can be performed in parallel to the renderable portions of your web-page without slowing down the rendering engine. Workers can spawn additional workers to get a complex task done more quickly. Workers can also make XMLHttpRequests (often cross-domain).

    Workers are remote-loaded scripts designed to respond to the published event/messaging interfaces which all workers enjoy.

    What can't a Worker do?
    Workers operate in a protected address space, each with its own global (self) context, and the DOM of hosting browser is off-limits!
    There is no window or document object! The only thing they share in common is the navigator and location objects.
    Communication between your page and any Worker is accomplished strictly by the use of messaging (postMessage, onmessage, onerror, etc).

    What about Google Gears Workers? Can I run HTML5 standards Worker scripts there instead?
    Normally, you could not, since Gears Workers support an evolving proprietary API.
    But with ux.Workers extension you can run an HTML5 Worker script unmodified as a Gears Worker!

    Demo: A live base64-encoding Worker.

    See/download more at

    Get used to Workers!
    You'll be thinking about using them a lot in future projects.

  2. #2
    Touch Premium Member
    Join Date
    Feb 2008


    Nice work Doug! I was intrigued when I read about them on Resig's blog but haven't had time to play yet. I was thinking web workers applied inside an Adobe Air application might be a natural fit. Though, I don't think we're quite there yet for Air.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts