fix(core): update

This commit is contained in:
2019-01-15 00:17:44 +01:00
parent 1152bb1138
commit e3f37f5027
8 changed files with 929 additions and 423 deletions

View File

@ -8,11 +8,8 @@ import * as smartdelay from '@pushrocks/smartdelay';
let testTask: taskbuffer.Task;
let testPreTask = new taskbuffer.Task({
taskFunction: function() {
let done = smartpromise.defer();
taskFunction: async () => {
console.log('preTask executed');
done.resolve();
return done.promise;
},
preTask: testTask
});
@ -35,14 +32,14 @@ let task1 = new taskbuffer.Task({
let task2 = new taskbuffer.Task({
name: 'Task 1',
taskFunction: () => {
let done = smartpromise.defer();
taskFunction: async () => {
const done = smartpromise.defer();
console.log('Task2 started');
setTimeout(() => {
console.log('Task2 executed');
done.resolve();
}, 5000);
return done.promise;
await done.promise;
}
});

View File

@ -1,7 +1,7 @@
import { expect, tap } from '@pushrocks/tapbundle';
import taskbuffer = require('../ts/index');
import * as smartq from 'smartq';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartdelay from '@pushrocks/smartdelay';
let task1Executed = false;