Commit Graph

11 Commits

Author SHA1 Message Date
Kevin Sawicki
8af55a04d8 Use a single worker for status refreshes
There still appear to be crashes occurring when
using libgit2 from multiple workers at the same time.

So only start a new status worker once the current one
completes if a refresh was requested while a worker was
running.

Closes #367
2013-03-06 14:59:12 -08:00
Kevin Sawicki
7952dfc196 Add command after first argument
This forces the object to be interpreted as the
second argument to the callWorkerMethod function
instead of as the first argument to function returned
from callWorkerMethod.

Closes #338
2013-03-03 11:07:52 -08:00
Corey Johnson & Kevin Sawicki
e4f87d522f Rename Task.terminate to Task.abort 2013-02-19 10:57:04 -08:00
Corey Johnson & Kevin Sawicki
7db83662b5 Only terminate worker after the worker completes work 2013-02-19 10:57:04 -08:00
Corey Johnson & Kevin Sawicki
c1203d48e2 Only call terminate when worker isn't null 2013-02-08 17:28:05 -08:00
Corey Johnson & Kevin Sawicki
e959c371e3 Terminate task when fuzzy finder is deactivated
Task no longer invokes task methods after task has
been terminated.
2013-02-08 17:28:05 -08: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
75da205b0a Terminate worker when all snippets have been loaded 2013-01-27 22:26:45 -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
2393bd0e9e Create task shell that bootstraps worker 2013-01-24 17:22:50 -08:00
Kevin Sawicki
9ab730b3d0 Load snippets in a web worker
A single web worker is now used to load
snippets one bundle at a time.
2013-01-24 17:22:50 -08:00