cujojs/curl — pull request #130 by alanpearce (2012-08-21 20:39:59+00:00)
Title: WebWorker support (still WIP)

I created a plugin to load a module as a worker, and created a shim to enable curl to load scripts from inside a worker. The makefiles were updated to build a worker-specific version and add to the kitchen sink.

There isn't any detection for worker support right now and I'm not quite certain about the best way to implement that, or if that should be a concern of this code (and curl).

There are a few ways I thought of to do this:
- The most obvious way (to me) would be to just `require` the file as normal in the worker plugin, perhaps using `setTimeout` to fake asynchronicity. This seems like a bad idea though—it might lock up the browser.
- Alternatively, a `Worker` shim could be added, to return `Worker`, whether it's fake or real. Kind of the same as the above.
- Do something with `has!`, loading a non-worker module instead if the browser doesn't support Workers. This seems most reasonable.

See #122 for more history.