Skip to content

Instantly share code, notes, and snippets.

@mohayonao
mohayonao / worker.coffee
Last active December 16, 2015 06:39 — forked from hitode909/worker.coffee
流れるようなインターフェイス, 引数つき
class Worker
constructor: (@context=@)->
@jobs = []
register: (job) ->
@jobs.push job
work: ->
job = do @jobs.shift
args = [=> @work.apply @, arguments].concat [].slice.call arguments