Commit Graph

12 Commits

Author SHA1 Message Date
Cheng Zhao
7effc4c456 💄 2013-03-27 12:25:55 +08:00
Cheng Zhao
b5be1c378a Replace Task's implementation with ProcessTask. 2013-03-27 12:25:54 +08:00
Kevin Sawicki
eea02cb807 Remove unneeded coffee-script require
This is handled by the wrapper around task-shell
to ensure coffee-script is required before the shell
is.
2013-03-12 13:06:23 -07:00
Kevin Sawicki & Nathan Sobo
1d1ba5f6d1 Use node's require instead of internal require 2013-03-12 10:38:05 -07:00
Kevin Sawicki & Nathan Sobo
fbd6364f78 Redirect worker console to window console
Use __defineGetter__ instead of setting a
console property on self because cefode
already defines a console via __defineGetter__
and we need to override it.
2013-03-05 14:52:39 -08:00
Cheng Zhao
091851ee3d First taste of node. 2013-03-05 09:10:04 +01:00
Kevin Sawicki
cd07ec841d Add more window globals and shims in task shell
This allows jQuery to be successfully loaded from a web worker
since it does not have a document or window object by default.

Previously it would log about missing methods and properties.

Closes #228
2013-02-04 11:43:58 -08:00
Kevin Sawicki
9b4d570989 Require config when task shell starts
Config adds to the require paths so it needs to be required
before the handler starts so that web worker handlers have the
same require semantics as the main window.
2013-01-29 10:28:58 -08:00
Nathan Sobo
0726987896 Give Task an RPC-style interaction with its Worker
This commit makes all interactions between Task and Worker look
like method calls. The worker now has a global `callTaskMethod`
function that it can use to call methods on the Task object. And the
Task can use `callWorkerMethod` to call methods on a global `handler`
object in the worker. The worker's initial `handler` actually contains
the `start` method, which the Task initially calls to kick things off.
Then the global `handler` gets replaced with whatever `handlerPath`
is specified by the Task. The worker then calls `workerStarted` on its
parent Task object.

This commit also gets rid of the `onProgress` method with the reply
semantics, favoring a more explicit interaction. When `snippetsLoaded`
finishes adding the snippet data, we call `loadNextPackageSnippets`
explicitly rather than returning a reply message.
2013-01-24 17:22:50 -08:00
Kevin Sawicki
69c9ed3feb Use self instead of hacky eval 2013-01-24 17:22:50 -08:00
Kevin Sawicki
3dd11c6c0f Set type to log for console.log forwarding 2013-01-24 17:22:50 -08:00
Kevin Sawicki
2393bd0e9e Create task shell that bootstraps worker 2013-01-24 17:22:50 -08:00