UNPKG

348 Btext/coffeescriptView Raw
1#!/usr/bin/env coffee
2require('coffee-script').register()
3bobbin = require '../src/bobbin.coffee'
4
5pool = bobbin.create()
6
7work = (i, cb) ->
8 foo = 0.5
9
10 #console.log 'working...'
11
12 for j in [1..10000]
13 foo += Math.random()
14 foo /= 2
15
16 cb null, i
17
18log_result = (err, result) -> console.log(result)
19
20pool.run(i, work, log_result) for i in [1..20]