UNPKG

373 BJavaScriptView Raw
1
2
3var t= require('../');
4
5function killHandler (data) {
6 console.log("GOT KILL with data -> "+ data);
7 o.destroy();
8}
9
10function boot () {
11 thread.once('kill', function (data) {
12 thread.emit('kill', data);
13 });
14}
15
16o= t.create().once('kill', killHandler).eval(boot).eval('boot()').emit('kill', "*** DATA");
17
18process.on('exit', function () {
19 console.log("Bye!");
20});