Create task shell that bootstraps worker

This commit is contained in:
Kevin Sawicki
2013-01-24 11:58:40 -08:00
parent 9ab730b3d0
commit 2393bd0e9e
4 changed files with 48 additions and 45 deletions

View File

@@ -1,13 +1,12 @@
module.exports =
class Task
constructor: (path) ->
@path = require.getPath(path)
constructor: (@path) ->
onProgress: (event) ->
start: ->
worker = new Worker(@path)
worker = new Worker(require.getPath('task-shell'))
worker.onmessage = (event) =>
switch event.data.type
when 'warn'
@@ -24,3 +23,4 @@ class Task
type: 'start'
resourcePath: window.resourcePath
requirePath: require.getPath('require')
taskPath: @path