Move status close to entity
This commit is contained in:
parent
ca3d71ea48
commit
e26bed2e66
@ -7,12 +7,6 @@ var debug = require('../util/debug')('scheduler');
|
||||
|
||||
var forever = require('../util/forever');
|
||||
|
||||
var STATUS = {
|
||||
PENDING: 'pending',
|
||||
RUNNING: 'running',
|
||||
DONE: 'done'
|
||||
};
|
||||
|
||||
function Scheduler(capacity, taskRunner) {
|
||||
EventEmitter.call(this);
|
||||
this.taskRunner = taskRunner;
|
||||
@ -116,6 +110,15 @@ Scheduler.prototype.release = function(err, taskEntity) {
|
||||
this.emit('release');
|
||||
};
|
||||
|
||||
|
||||
/* Task entities */
|
||||
|
||||
var STATUS = {
|
||||
PENDING: 'pending',
|
||||
RUNNING: 'running',
|
||||
DONE: 'done'
|
||||
};
|
||||
|
||||
function TaskEntity(user) {
|
||||
this.user = user;
|
||||
this.status = STATUS.PENDING;
|
||||
|
Loading…
Reference in New Issue
Block a user