Compare commits

..

9 Commits

Author SHA1 Message Date
3f7f38ee17 1.0.20 2017-07-10 12:49:04 +02:00
5bfc72a602 add docs 2017-07-10 12:48:57 +02:00
ca8882962e 1.0.19 2017-07-10 12:45:36 +02:00
df6bf2c681 updated dependencies 2017-07-10 12:45:33 +02:00
310a683e14 1.0.18 2017-07-10 12:42:11 +02:00
3f275ebc08 implemented execDelay 2017-07-10 12:42:06 +02:00
01d469960e 1.0.17 2017-06-18 13:25:12 +02:00
2ed701040a now has working TaskManager 2017-06-18 13:25:09 +02:00
ca3bb38205 update test texts 2017-06-17 17:29:26 +02:00
18 changed files with 396 additions and 123 deletions

1
dist/index.d.ts vendored
View File

@ -1,4 +1,5 @@
export { Task, ITaskFunction } from './taskbuffer.classes.task'; export { Task, ITaskFunction } from './taskbuffer.classes.task';
export { Taskchain } from './taskbuffer.classes.taskchain'; export { Taskchain } from './taskbuffer.classes.taskchain';
export { Taskparallel } from './taskbuffer.classes.taskparallel'; export { Taskparallel } from './taskbuffer.classes.taskparallel';
export { TaskManager } from './taskbuffer.classes.taskmanager';
import './taskbuffer.classes.helpers'; import './taskbuffer.classes.helpers';

4
dist/index.js vendored
View File

@ -6,6 +6,8 @@ var taskbuffer_classes_taskchain_1 = require("./taskbuffer.classes.taskchain");
exports.Taskchain = taskbuffer_classes_taskchain_1.Taskchain; exports.Taskchain = taskbuffer_classes_taskchain_1.Taskchain;
var taskbuffer_classes_taskparallel_1 = require("./taskbuffer.classes.taskparallel"); var taskbuffer_classes_taskparallel_1 = require("./taskbuffer.classes.taskparallel");
exports.Taskparallel = taskbuffer_classes_taskparallel_1.Taskparallel; exports.Taskparallel = taskbuffer_classes_taskparallel_1.Taskparallel;
var taskbuffer_classes_taskmanager_1 = require("./taskbuffer.classes.taskmanager");
exports.TaskManager = taskbuffer_classes_taskmanager_1.TaskManager;
// import for naming only // import for naming only
require("./taskbuffer.classes.helpers"); require("./taskbuffer.classes.helpers");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHFFQUE0RDtBQUFwRCx5Q0FBQSxJQUFJLENBQUE7QUFDWiwrRUFBd0Q7QUFBaEQsbURBQUEsU0FBUyxDQUFBO0FBQ2pCLHFGQUE4RDtBQUF0RCx5REFBQSxZQUFZLENBQUE7QUFFcEIseUJBQXlCO0FBQ3pCLHdDQUFxQyJ9 //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHFFQUE0RDtBQUFwRCx5Q0FBQSxJQUFJLENBQUE7QUFDWiwrRUFBd0Q7QUFBaEQsbURBQUEsU0FBUyxDQUFBO0FBQ2pCLHFGQUE4RDtBQUF0RCx5REFBQSxZQUFZLENBQUE7QUFDcEIsbUZBQThEO0FBQXJELHVEQUFBLFdBQVcsQ0FBQTtBQUVwQix5QkFBeUI7QUFDekIsd0NBQXFDIn0=

View File

@ -21,10 +21,8 @@ export declare class CycleCounter {
export declare class BufferRunner { export declare class BufferRunner {
task: Task; task: Task;
bufferCounter: number; bufferCounter: number;
bufferMax: number;
running: boolean; running: boolean;
constructor(taskArg: Task); constructor(taskArg: Task);
setBufferMax(bufferMaxArg: number): void;
trigger(x: any): Promise<any>; trigger(x: any): Promise<any>;
private _run(x); private _run(x);
} }

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,8 @@ export declare class Task {
name: string; name: string;
taskFunction: ITaskFunction; taskFunction: ITaskFunction;
buffered: boolean; buffered: boolean;
bufferMax: number;
execDelay: number;
preTask: Task; preTask: Task;
afterTask: Task; afterTask: Task;
running: boolean; running: boolean;
@ -14,11 +16,34 @@ export declare class Task {
idle: boolean; idle: boolean;
private _state; private _state;
constructor(optionsArg: { constructor(optionsArg: {
/**
* the task function to run, must return promise
*/
taskFunction: ITaskFunction; taskFunction: ITaskFunction;
/**
* any other task to run before
*/
preTask?: Task; preTask?: Task;
/**
* any other task to run after
*/
afterTask?: Task; afterTask?: Task;
/**
* wether this task should run buffered
*/
buffered?: boolean; buffered?: boolean;
/**
* the maximum buffer
*/
bufferMax?: number; bufferMax?: number;
/**
* the execution delay, before the task is executed
* only makes sense when running in buffered mode
*/
execDelay?: number;
/**
* the name of the task
*/
name?: string; name?: string;
}); });
/** /**

View File

@ -10,14 +10,14 @@ class Task {
this.cycleCounter = new helpers.CycleCounter(this); this.cycleCounter = new helpers.CycleCounter(this);
this.idle = true; this.idle = true;
this._state = 'ready'; this._state = 'ready';
let options = optionsArg;
this.taskFunction = optionsArg.taskFunction; this.taskFunction = optionsArg.taskFunction;
this.preTask = options.preTask; this.preTask = optionsArg.preTask;
this.afterTask = options.afterTask; this.afterTask = optionsArg.afterTask;
this.idle = !this.running; this.idle = !this.running;
this.buffered = options.buffered; this.buffered = optionsArg.buffered;
this.bufferRunner.setBufferMax(options.bufferMax); this.bufferMax = optionsArg.bufferMax;
this.name = options.name; this.execDelay = optionsArg.execDelay;
this.name = optionsArg.name;
} }
/** /**
* trigger the task. Will trigger buffered if this.buffered is true * trigger the task. Will trigger buffered if this.buffered is true
@ -55,4 +55,4 @@ class Task {
} }
} }
exports.Task = Task; exports.Task = Task;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXNrYnVmZmVyLmNsYXNzZXMudGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGdEQUErQztBQUMvQyx3REFBdUQ7QUFNdkQ7SUFjRSxZQUFhLFVBT1o7UUFkRCx3Qk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UMsQ0FBQTtRQUNsQyxDQUFDO0lBQ0gsQ0FBQztJQUVEOztPQUVHO0lBQ0gsaUJBQWlCLENBQUMsQ0FBRTtRQUNsQixNQUFNLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQTtJQUN4QyxDQUFDO0lBRUQ7O09BRUc7SUFDSCxlQUFlLENBQUMsQ0FBRTtRQUNoQixNQUFNLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUE7SUFDckMsQ0FBQztJQUVELElBQUksS0FBSztRQUNQLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFBO0lBQ3BCLENBQUM7SUFFRCxJQUFJLEtBQUssQ0FBQyxRQUFnQjtRQUN4QixFQUFFLENBQUMsQ0FBQyxRQUFRLEtBQUssUUFBUSxDQUFDLENBQUMsQ0FBQztZQUMxQixJQUFJLENBQUMsTUFBTSxHQUFHLFFBQVEsQ0FBQTtRQUN4QixDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDTixPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxhQUFhLEdBQUcsUUFBUSxHQUFHLG1CQUFtQixDQUFDLENBQUE7UUFDekUsQ0FBQztJQUNILENBQUM7Q0FDRjtBQWxHRCxvQkFrR0MifQ==

View File

@ -2,7 +2,7 @@ import { Task } from './taskbuffer.classes.task';
import { Objectmap } from 'lik'; import { Objectmap } from 'lik';
export declare class TaskManager { export declare class TaskManager {
taskMap: Objectmap<Task>; taskMap: Objectmap<Task>;
private cronJobArray; private cronJobMap;
constructor(); constructor();
/** /**
* checks if a task is already present * checks if a task is already present
@ -24,12 +24,13 @@ export declare class TaskManager {
* triggers a task in the TaskManagerByName * triggers a task in the TaskManagerByName
* @param taskNameArg * @param taskNameArg
*/ */
triggerTaskByName(taskNameArg: string): void; triggerTaskByName(taskNameArg: string): Promise<any>;
/** /**
* schedules the task by name * schedules the task by name
* @param taskNameArg * @param taskNameArg
*/ */
scheduleTaskByName(taskNameArg: string, cronStringArg: string): void; scheduleTaskByName(taskNameArg: string, cronStringArg: string): void;
descheduleTaskByName(taskNameArg: string): void;
/** /**
* returns all schedules of a specific task * returns all schedules of a specific task
* @param taskNameArg * @param taskNameArg

View File

@ -4,7 +4,7 @@ const plugins = require("./taskbuffer.plugins");
class TaskManager { class TaskManager {
constructor() { constructor() {
this.taskMap = new plugins.lik.Objectmap(); this.taskMap = new plugins.lik.Objectmap();
this.cronJobArray = []; this.cronJobMap = new plugins.lik.Objectmap();
// nothing here // nothing here
} }
/** /**
@ -45,7 +45,7 @@ class TaskManager {
if (!taskToTrigger) { if (!taskToTrigger) {
throw new Error(`There is no task with the name of ${taskNameArg}`); throw new Error(`There is no task with the name of ${taskNameArg}`);
} }
taskToTrigger.trigger(); return taskToTrigger.trigger();
} }
/** /**
* schedules the task by name * schedules the task by name
@ -55,15 +55,23 @@ class TaskManager {
let taskToSchedule = this.getTaskByName(taskNameArg); let taskToSchedule = this.getTaskByName(taskNameArg);
let job = new plugins.cron.CronJob({ let job = new plugins.cron.CronJob({
cronTime: cronStringArg, cronTime: cronStringArg,
onTick: taskToSchedule.trigger, onTick: () => {
this.triggerTaskByName(taskNameArg);
},
start: true start: true
}); });
this.cronJobArray.push({ this.cronJobMap.add({
taskNameArg: taskToSchedule.name, taskNameArg: taskToSchedule.name,
cronString: cronStringArg, cronString: cronStringArg,
job: job job: job
}); });
} }
descheduleTaskByName(taskNameArg) {
let descheduledCron = this.cronJobMap.findOneAndRemove((itemArg) => {
return itemArg.taskNameArg === taskNameArg;
});
descheduledCron.job.stop();
}
/** /**
* returns all schedules of a specific task * returns all schedules of a specific task
* @param taskNameArg * @param taskNameArg
@ -72,4 +80,4 @@ class TaskManager {
} }
} }
exports.TaskManager = TaskManager; exports.TaskManager = TaskManager;
//# sourceMappingURL=data:application/json;base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DQUFDLGdCQUFnQixDQUFDLENBQUMsT0FBTztZQUM3RCxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsS0FBSyxXQUFXLENBQUE7UUFDNUMsQ0FBQyxDQUFDLENBQUE7UUFDRixlQUFlLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxDQUFBO0lBQzVCLENBQUM7SUFDRDs7O09BR0c7SUFDSCx1QkFBdUIsQ0FBRSxXQUFtQjtJQUU1QyxDQUFDO0NBQ0Y7QUFwRkQsa0NBb0ZDIn0=

76
docs/index.md Normal file
View File

@ -0,0 +1,76 @@
# taskbuffer
flexible task management. TypeScript ready!
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/taskbuffer)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/taskbuffer)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/taskbuffer)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/taskbuffer/)
## Status for master
[![build status](https://GitLab.com/pushrocks/taskbuffer/badges/master/build.svg)](https://GitLab.com/pushrocks/taskbuffer/commits/master)
[![coverage report](https://GitLab.com/pushrocks/taskbuffer/badges/master/coverage.svg)](https://GitLab.com/pushrocks/taskbuffer/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/taskbuffer.svg)](https://www.npmjs.com/package/taskbuffer)
[![Dependency Status](https://david-dm.org/pushrocks/taskbuffer.svg)](https://david-dm.org/pushrocks/taskbuffer)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/taskbuffer/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/taskbuffer/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/taskbuffer/badges/code.svg)](https://www.bithound.io/github/pushrocks/taskbuffer)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Install
```sh
npm install taskbuffer --save
```
## Concepts
### class `Task`
* A Task in its most simple form is a function that is executed when the task runs.
* A Task can have a **preTask** and an **afterTask**
(those are run before or after the main function whenever the task is called)
* A Task can be buffered.
That means it can be called multiple times in a very short time.
However execution happens in line:
meaning execution of the task's main function is on halt until the previous task call has finished.
You can set bufferMax number, which is the max number of buffered task calls.
Any additional calls will then be truncated
* Task.trigger() and Task.triggerBuffered() always return a Promise
which is fullfilled once the related task call has completed.
* Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
* Task is compatible to gulp streams.
### class `TaskChain`
* TaskChain extends Task.
* Multiple Tasks can be combined in a bigger task using a TaskChain.
* While the tasks are async in themselve, TaskChain **runs Tasks serialized** (one after the other)
* that means that tasks can rely on each other and
### class `TaskParallel`
* TaskParallel extends Task.
* like TaskChain, however **tasks run in parallel**
* Tasks cannot rely on each other.
### Usage
We highly recommend TypeScript as this module supports **TypeScript intellisense**.
```javascript
import * as taskbuffer from "taskbuffer";
myTask = new taskbuffer.Task({
preTask: someOtherTask // optional, don't worry loops are prevented
afterTask: someOtherTask // optional, don't worry loops are prevented
name:"myTask1",
taskFunction:() => {
// do some stuff and return promise
// pass on any data through promise resolution
// Use TypeScript for better understanding and code completion
}
})
```
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -1,6 +1,6 @@
{ {
"name": "taskbuffer", "name": "taskbuffer",
"version": "1.0.16", "version": "1.0.20",
"description": "flexible task management. TypeScript ready!", "description": "flexible task management. TypeScript ready!",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
@ -29,14 +29,14 @@
"@types/lodash": "4.x.x", "@types/lodash": "4.x.x",
"beautylog": "^6.1.10", "beautylog": "^6.1.10",
"cron": "^1.2.1", "cron": "^1.2.1",
"lik": "^1.0.31", "lik": "^1.0.38",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"rxjs": "^5.4.1", "rxjs": "^5.4.2",
"smartdelay": "^1.0.3", "smartdelay": "^1.0.3",
"smartq": "^1.1.1", "smartq": "^1.1.6",
"typings-global": "^1.0.17" "typings-global": "^1.0.19"
}, },
"devDependencies": { "devDependencies": {
"tapbundle": "^1.0.14" "tapbundle": "^1.1.0"
} }
} }

View File

@ -63,37 +63,37 @@ tap.test('new Task() should return a new task', async () => {
testTask = new taskbuffer.Task({ taskFunction: async () => { console.log('executed twice') }, preTask: testPreTask }) testTask = new taskbuffer.Task({ taskFunction: async () => { console.log('executed twice') }, preTask: testPreTask })
}) })
tap.test('testTask should be and instance of Task', async () => { tap.test('expect testTask to be an instance of Task', async () => {
expect(testTask).to.be.instanceof(taskbuffer.Task) expect(testTask).to.be.instanceof(taskbuffer.Task)
}) })
tap.test('testTask.idle is true', async () => { tap.test('expect testTask.idle is true', async () => {
if (!testTask.idle) { if (!testTask.idle) {
throw new Error('testTask.idle is not true') throw new Error('testTask.idle is not true')
} }
}) })
tap.test('testTask.running is type boolean and initially false', async () => { tap.test('testTask.running should be of type boolean and initially false', async () => {
expect(testTask.running).to.be.a('boolean') expect(testTask.running).to.be.a('boolean')
// tslint:disable-next-line:no-unused-expression // tslint:disable-next-line:no-unused-expression
expect(testTask.running).to.be.false expect(testTask.running).to.be.false
}) })
tap.test('testTask.trigger() expect return Promise', async () => { tap.test('testTask.trigger() should return Promise', async () => {
expect(testTask.trigger()).to.be.instanceof(Promise) expect(testTask.trigger()).to.be.instanceof(Promise)
}) })
tap.test('testTask.trigger() returned Promise expect be fullfilled', async () => { tap.test('testTask.trigger() returned Promise should be fullfilled', async () => {
await testTask.trigger() await testTask.trigger()
}) })
tap.test('expect run a task without pre and afterTask', async () => { tap.test('expect to run a task without pre and afterTask errorless', async () => {
let localTestTask = new taskbuffer.Task({ taskFunction: async () => { console.log('only once') } }) let localTestTask = new taskbuffer.Task({ taskFunction: async () => { console.log('only once') } })
await localTestTask.trigger() await localTestTask.trigger()
}) })
tap.test('expect run buffered', async () => { tap.test('expect task to run in buffered mode', async () => {
let localTestTask = new taskbuffer.Task({ let localTestTask = new taskbuffer.Task({
taskFunction: async () => { await smartdelay.delayFor(3000) }, taskFunction: async () => { await smartdelay.delayFor(3000) },
buffered: true, buffered: true,

View File

@ -0,0 +1,40 @@
import { expect, tap } from 'tapbundle'
import taskbuffer = require('../dist/index')
import * as smartq from 'smartq'
import * as smartdelay from 'smartdelay'
let myTaskManager: taskbuffer.TaskManager
let taskRunCounter = 0
let taskDone = smartq.defer()
tap.test('should create an instance of TaskManager', async () => {
myTaskManager = new taskbuffer.TaskManager()
expect(myTaskManager).to.be.instanceof(taskbuffer.TaskManager)
})
tap.test('should run the task as expected', async () => {
let referenceBoolean = false
myTaskManager.addTask(new taskbuffer.Task({
name: 'myTask',
taskFunction: async () => {
console.log('Task executed!')
referenceBoolean = true
taskRunCounter++
if (taskRunCounter === 10) {
taskDone.resolve()
}
}
}))
await myTaskManager.triggerTaskByName('myTask')
// tslint:disable-next-line:no-unused-expression
expect(referenceBoolean).to.be.true
})
tap.test('should schedule task', async () => {
myTaskManager.scheduleTaskByName('myTask', '* * * * * *')
await taskDone.promise
myTaskManager.descheduleTaskByName('myTask')
})
tap.start()

View File

@ -46,17 +46,17 @@ tap.test('should let a value flow through a task', async () => {
expect(result).to.equal(12) expect(result).to.equal(12)
}) })
tap.test('should let a values flow between tasks', async () => { tap.test('expect values to flow between tasks', async () => {
let result = await flowTask2.trigger(12) let result = await flowTask2.trigger(12)
expect(result).to.equal(12) expect(result).to.equal(12)
}) })
tap.test('expect let a values flow between tasks when buffered', async () => { tap.test('expect values to flow between tasks when buffered', async () => {
let result = await flowTaskBuffered.trigger(12) let result = await flowTaskBuffered.trigger(12)
expect(result).to.equal(12) expect(result).to.equal(12)
}) })
tap.test('should let a values flow between tasks in Taskchain', async () => { tap.test('expect values to flow between tasks in Taskchain', async () => {
let result = await flowTask3.trigger(12) let result = await flowTask3.trigger(12)
expect(result).to.equal(12) expect(result).to.equal(12)
}) })

View File

@ -1,6 +1,7 @@
export {Task,ITaskFunction} from './taskbuffer.classes.task' export {Task,ITaskFunction} from './taskbuffer.classes.task'
export {Taskchain} from './taskbuffer.classes.taskchain' export {Taskchain} from './taskbuffer.classes.taskchain'
export {Taskparallel} from './taskbuffer.classes.taskparallel' export {Taskparallel} from './taskbuffer.classes.taskparallel'
export { TaskManager } from './taskbuffer.classes.taskmanager'
// import for naming only // import for naming only
import './taskbuffer.classes.helpers' import './taskbuffer.classes.helpers'

View File

@ -28,12 +28,18 @@ export let isTaskTouched = (taskArg: Task, touchedTasksArray: Task[]): boolean =
return result return result
} }
export let runTask = function (taskArg: Task, optionsArg: { x?, touchedTasksArray?: Task[] }) { export let runTask = async (taskArg: Task, optionsArg: { x?, touchedTasksArray?: Task[] }) => {
let done = plugins.q.defer() let done = plugins.q.defer()
// pay respect to execDelay
if (taskArg.execDelay) {
await plugins.smartdelay.delayFor(taskArg.execDelay)
}
// set running params // set running params
taskArg.running = true taskArg.running = true
done.promise.then(function () { taskArg.running = false })
done.promise.then(async () => { taskArg.running = false })
// handle options // handle options
let options = plugins.lodash.merge( let options = plugins.lodash.merge(
@ -75,7 +81,7 @@ export let runTask = function (taskArg: Task, optionsArg: { x?, touchedTasksArra
console.log(err) console.log(err)
}) })
localDeferred.resolve() localDeferred.resolve()
return done.promise return await done.promise
} }
export interface cycleObject { export interface cycleObject {
@ -116,18 +122,13 @@ export class BufferRunner {
task: Task task: Task
// initialze by default // initialze by default
bufferCounter: number = 0 bufferCounter: number = 0
bufferMax: number = 1
running: boolean = false running: boolean = false
constructor(taskArg: Task) { constructor(taskArg: Task) {
this.task = taskArg this.task = taskArg
} }
setBufferMax (bufferMaxArg: number) {
this.bufferMax = bufferMaxArg
}
trigger (x): Promise<any> { trigger (x): Promise<any> {
if (!(this.bufferCounter >= this.bufferMax)) { if (!(this.bufferCounter >= this.task.bufferMax)) {
this.bufferCounter++ this.bufferCounter++
} }
let returnPromise: Promise<any> = this.task.cycleCounter.getPromiseForCycle(this.bufferCounter + 1) let returnPromise: Promise<any> = this.task.cycleCounter.getPromiseForCycle(this.bufferCounter + 1)

View File

@ -6,9 +6,15 @@ export interface ITaskFunction {
} }
export class Task { export class Task {
// man datory properties
name: string name: string
taskFunction: ITaskFunction taskFunction: ITaskFunction
buffered: boolean buffered: boolean
bufferMax: number
execDelay: number
// tasks to run before and after
preTask: Task preTask: Task
afterTask: Task afterTask: Task
@ -16,25 +22,49 @@ export class Task {
running: boolean = false running: boolean = false
bufferRunner = new helpers.BufferRunner(this) bufferRunner = new helpers.BufferRunner(this)
cycleCounter = new helpers.CycleCounter(this) cycleCounter = new helpers.CycleCounter(this)
idle: boolean = true idle: boolean = true
private _state: string = 'ready' private _state: string = 'ready'
constructor(optionsArg: { constructor(optionsArg: {
taskFunction: ITaskFunction, /**
preTask?: Task, * the task function to run, must return promise
afterTask?: Task, */
buffered?: boolean, taskFunction: ITaskFunction
bufferMax?: number, /**
* any other task to run before
*/
preTask?: Task
/**
* any other task to run after
*/
afterTask?: Task
/**
* wether this task should run buffered
*/
buffered?: boolean
/**
* the maximum buffer
*/
bufferMax?: number
/**
* the execution delay, before the task is executed
* only makes sense when running in buffered mode
*/
execDelay?: number
/**
* the name of the task
*/
name?: string name?: string
}) { }) {
let options = optionsArg
this.taskFunction = optionsArg.taskFunction this.taskFunction = optionsArg.taskFunction
this.preTask = options.preTask this.preTask = optionsArg.preTask
this.afterTask = options.afterTask this.afterTask = optionsArg.afterTask
this.idle = !this.running this.idle = !this.running
this.buffered = options.buffered this.buffered = optionsArg.buffered
this.bufferRunner.setBufferMax(options.bufferMax) this.bufferMax = optionsArg.bufferMax
this.name = options.name this.execDelay = optionsArg.execDelay
this.name = optionsArg.name
} }
/** /**
@ -65,6 +95,7 @@ export class Task {
get state(): string { get state(): string {
return this._state return this._state
} }
set state(stateArg: string) { set state(stateArg: string) {
if (stateArg === 'locked') { if (stateArg === 'locked') {
this._state = 'locked' this._state = 'locked'

View File

@ -6,7 +6,7 @@ import { Objectmap } from 'lik'
export class TaskManager { export class TaskManager {
taskMap = new plugins.lik.Objectmap<Task>() taskMap = new plugins.lik.Objectmap<Task>()
private cronJobArray: ICronJob[] = [] private cronJobMap = new plugins.lik.Objectmap<ICronJob>()
constructor () { constructor () {
// nothing here // nothing here
} }
@ -47,12 +47,12 @@ export class TaskManager {
* triggers a task in the TaskManagerByName * triggers a task in the TaskManagerByName
* @param taskNameArg * @param taskNameArg
*/ */
triggerTaskByName (taskNameArg: string) { triggerTaskByName (taskNameArg: string): Promise<any> {
let taskToTrigger = this.getTaskByName(taskNameArg) let taskToTrigger = this.getTaskByName(taskNameArg)
if (!taskToTrigger) { if (!taskToTrigger) {
throw new Error(`There is no task with the name of ${taskNameArg}`) throw new Error(`There is no task with the name of ${taskNameArg}`)
} }
taskToTrigger.trigger() return taskToTrigger.trigger()
} }
/** /**
@ -63,16 +63,24 @@ export class TaskManager {
let taskToSchedule = this.getTaskByName(taskNameArg) let taskToSchedule = this.getTaskByName(taskNameArg)
let job = new plugins.cron.CronJob({ let job = new plugins.cron.CronJob({
cronTime: cronStringArg, cronTime: cronStringArg,
onTick: taskToSchedule.trigger, onTick: () => {
this.triggerTaskByName(taskNameArg)
},
start: true start: true
}) })
this.cronJobArray.push({ this.cronJobMap.add({
taskNameArg: taskToSchedule.name, taskNameArg: taskToSchedule.name,
cronString: cronStringArg, cronString: cronStringArg,
job: job job: job
}) })
} }
descheduleTaskByName (taskNameArg: string) {
let descheduledCron = this.cronJobMap.findOneAndRemove((itemArg) => {
return itemArg.taskNameArg === taskNameArg
})
descheduledCron.job.stop()
}
/** /**
* returns all schedules of a specific task * returns all schedules of a specific task
* @param taskNameArg * @param taskNameArg

171
yarn.lock
View File

@ -15,7 +15,11 @@
dependencies: dependencies:
"@types/chai" "*" "@types/chai" "*"
"@types/chai@*", "@types/chai@^3.4.35": "@types/chai@*":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.1.tgz#37fea779617cfec3fd2b19a0247e8bbdd5133bf6"
"@types/chai@^3.4.35":
version "3.5.2" version "3.5.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
@ -23,29 +27,29 @@
version "1.2.1" version "1.2.1"
resolved "https://registry.yarnpkg.com/@types/cron/-/cron-1.2.1.tgz#95c1e432d6106ca34c92f0743638bc786c073faa" resolved "https://registry.yarnpkg.com/@types/cron/-/cron-1.2.1.tgz#95c1e432d6106ca34c92f0743638bc786c073faa"
"@types/lodash@4.x.x", "@types/lodash@^4.14.55", "@types/lodash@^4.14.62": "@types/lodash@4.x.x", "@types/lodash@^4.14.55", "@types/lodash@^4.14.67":
version "4.14.66" version "4.14.68"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.66.tgz#3dbb83477becf130611f8fac82a8fdb199805981" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.68.tgz#754fbab68bd2bbb69547dc8ce7574f7012eed7f6"
"@types/minimatch@2.x.x": "@types/minimatch@2.x.x":
version "2.0.29" version "2.0.29"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
"@types/node@*", "@types/node@^7.0.29": "@types/node@*":
version "7.0.31" version "8.0.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.31.tgz#80ea4d175599b2a00149c29a10a4eb2dff592e86" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.9.tgz#19f44c3b6cb8a70d261d366f73650e3e3891ab2d"
"@types/promises-a-plus@*": "@types/promises-a-plus@*":
version "0.0.27" version "0.0.27"
resolved "https://registry.yarnpkg.com/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz#c64651134614c84b8f5d7114ce8901d36a609780" resolved "https://registry.yarnpkg.com/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz#c64651134614c84b8f5d7114ce8901d36a609780"
"@types/q@1.x.x": "@types/q@1.x.x":
version "1.0.1" version "1.0.2"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.0.1.tgz#dbccb01bd8f0f801a12a4604c7d7af59bb02ae2f" resolved "https://registry.yarnpkg.com/@types/q/-/q-1.0.2.tgz#41f0b0f6ae0eeed3a51b003e2e08cba5525b74f6"
"@types/shelljs@^0.6.0": "@types/shelljs@^0.7.2":
version "0.6.0" version "0.7.2"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.6.0.tgz#090b705c102ce7fc5c0c5ea9b524418ff15840df" resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.2.tgz#c2bdb3fe80cd7a3da08750ca898ae44c589671f3"
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
@ -162,6 +166,13 @@ deep-eql@^0.1.3:
dependencies: dependencies:
type-detect "0.1.1" type-detect "0.1.1"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
early@^2.1.1: early@^2.1.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c" resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
@ -170,6 +181,23 @@ early@^2.1.1:
smartq "^1.1.1" smartq "^1.1.1"
typings-global "^1.0.16" typings-global "^1.0.16"
es-abstract@^1.5.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.0"
is-callable "^1.1.3"
is-regex "^1.0.3"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es6-error@^4.0.2: es6-error@^4.0.2:
version "4.0.2" version "4.0.2"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98" resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"
@ -182,10 +210,18 @@ figlet@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410" resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
fs.realpath@^1.0.0: fs.realpath@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
function-bind@^1.0.2, function-bind@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
glob@^7.0.0: glob@^7.0.0:
version "7.1.2" version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
@ -203,6 +239,12 @@ has-ansi@^2.0.0:
dependencies: dependencies:
ansi-regex "^2.0.0" ansi-regex "^2.0.0"
has@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
function-bind "^1.0.2"
inflight@^1.0.4: inflight@^1.0.4:
version "1.0.6" version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
@ -218,6 +260,24 @@ interpret@^1.0.0:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-regex@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
isexe@^2.0.0: isexe@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@ -236,20 +296,19 @@ left-pad@^1.1.3:
version "1.1.3" version "1.1.3"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
lik@^1.0.31: lik@^1.0.38:
version "1.0.31" version "1.0.38"
resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.31.tgz#5c7635d880cdbb28aeb1259223fd948797616bcd" resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.38.tgz#ccff0abd3d9236a5e4b7d80d514c5c210f18469b"
dependencies: dependencies:
"@types/lodash" "^4.14.62" "@types/lodash" "^4.14.67"
"@types/minimatch" "2.x.x" "@types/minimatch" "2.x.x"
"@types/q" "1.x.x" "@types/q" "1.x.x"
lodash "^4.17.4" lodash "^4.17.4"
minimatch "^3.0.3" minimatch "^3.0.4"
q "^1.5.0" q "^1.5.0"
rxjs "^5.3.0" rxjs "^5.4.1"
smartq "^1.1.1" smartq "^1.1.1"
tapbundle "^1.0.14" typings-global "^1.0.19"
typings-global "^1.0.14"
lodash@^4.17.4: lodash@^4.17.4:
version "4.17.4" version "4.17.4"
@ -272,7 +331,7 @@ mimic-fn@^1.0.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"
minimatch@^3.0.3, minimatch@^3.0.4: minimatch@^3.0.4:
version "3.0.4" version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies: dependencies:
@ -296,6 +355,17 @@ nan@^2.3.2:
version "2.6.2" version "2.6.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.1"
once@^1.3.0: once@^1.3.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@ -352,9 +422,9 @@ restore-cursor@^2.0.0:
onetime "^2.0.0" onetime "^2.0.0"
signal-exit "^3.0.2" signal-exit "^3.0.2"
rxjs@^5.3.0, rxjs@^5.4.1: rxjs@^5.4.1, rxjs@^5.4.2:
version "5.4.1" version "5.4.2"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.1.tgz#b62f757f279445d265a18a58fb0a70dc90e91626" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.2.tgz#2a3236fcbf03df57bae06fd6972fd99e5c08fcf7"
dependencies: dependencies:
symbol-observable "^1.0.1" symbol-observable "^1.0.1"
@ -362,7 +432,7 @@ semver@^5.3.0:
version "5.3.0" version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
shelljs@^0.7.6: shelljs@^0.7.8:
version "0.7.8" version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
dependencies: dependencies:
@ -400,22 +470,23 @@ smartenv@^2.0.0:
smartq "^1.1.1" smartq "^1.1.1"
typings-global "^1.0.14" typings-global "^1.0.14"
smartq@^1.1.0, smartq@^1.1.1: smartq@^1.1.1, smartq@^1.1.6:
version "1.1.1" version "1.1.6"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.1.tgz#efb358705260d41ae18aef7ffd815f7b6fe17dd3" resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
dependencies: dependencies:
typed-promisify "^0.3.0" typings-global "^1.0.19"
typings-global "^1.0.14" util.promisify "^1.0.0"
smartshell@^1.0.6: smartshell@^1.0.6:
version "1.0.6" version "1.0.8"
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.6.tgz#27b1c79029784abe72ac7e91fe698b7ebecc6629" resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.8.tgz#1535756c0fe8069f7e6da1e3f9cb6c8f77094e42"
dependencies: dependencies:
"@types/shelljs" "^0.6.0" "@types/shelljs" "^0.7.2"
"@types/which" "^1.0.28" "@types/which" "^1.0.28"
shelljs "^0.7.6" shelljs "^0.7.8"
smartq "^1.1.0" smartq "^1.1.1"
which "^1.2.12" typings-global "^1.0.19"
which "^1.2.14"
strip-ansi@^3.0.0: strip-ansi@^3.0.0:
version "3.0.1" version "3.0.1"
@ -431,16 +502,16 @@ symbol-observable@^1.0.1:
version "1.0.4" version "1.0.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
tapbundle@^1.0.14: tapbundle@^1.1.0:
version "1.0.14" version "1.1.0"
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.0.14.tgz#75827e335fcb02216f0267a26a26d702ddc02e3c" resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.0.tgz#e0547f683ae36260f639ecd7435df95f0af01683"
dependencies: dependencies:
early "^2.1.1" early "^2.1.1"
leakage "^0.3.0" leakage "^0.3.0"
smartchai "^1.0.3" smartchai "^1.0.3"
smartdelay "^1.0.3" smartdelay "^1.0.3"
smartq "^1.1.1" smartq "^1.1.1"
typings-global "^1.0.16" typings-global "^1.0.19"
type-detect@0.1.1: type-detect@0.1.1:
version "0.1.1" version "0.1.1"
@ -450,19 +521,21 @@ type-detect@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
typed-promisify@^0.3.0: typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19:
version "0.3.0" version "1.0.19"
resolved "https://registry.yarnpkg.com/typed-promisify/-/typed-promisify-0.3.0.tgz#1ba0af5e444c87d8047406f18ce49092a1191853" resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.19.tgz#3376a72d4de1e5541bf5702248ff64c3e6ea316c"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17:
version "1.0.17"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.17.tgz#41edc331ccec3168289adc8849e1e255efbe7152"
dependencies: dependencies:
"@types/node" "^7.0.29"
semver "^5.3.0" semver "^5.3.0"
smartshell "^1.0.6" smartshell "^1.0.6"
which@^1.2.12: util.promisify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
dependencies:
define-properties "^1.1.2"
object.getownpropertydescriptors "^2.0.3"
which@^1.2.14:
version "1.2.14" version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies: dependencies: