-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
37 lines (26 loc) · 965 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var task = require('task');
process.on('SIGWINCH', console.log);
process.removeListener('SIGWINCH', console.log);
console.log('startup: should be root task: %d', currentTask.id);
process.nextTick(function() {
console.log('nextTick: should be root task: %d', currentTask.id);
});
task.create(function(cb) {
console.log('task.create: should be user task: %d', currentTask.id);
process.nextTick(function() {
console.log('nextTick: should be user task: %d', currentTask.id);
//cb(1);
});
process.nextTick(function() {
console.log('nextTick[2]: should be user task: %d', currentTask.id);
task.create(function(cb2) {
console.log('sub-subtask %d', currentTask.id);
process.nextTick(function() {
cb2('done');
});
}).setCallback(cb);
});
//throw new Error("poep");
}).setCallback(function(err, result) {
console.log('callback: back in task %d. error: %s. result: %s', currentTask.id, err, result);
});