document shard

This commit is contained in:
Amish Shah
2016-09-04 12:37:36 +01:00
parent 7475f734ac
commit 0454674ceb
2 changed files with 13 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,20 @@ const path = require('path');
*/
class Shard {
constructor(manager, id) {
/**
* The manager of the spawned shard
* @type {ShardingManager}
*/
this.manager = manager;
/**
* The shard id
* @type {number}
*/
this.id = id;
/**
* The process of the shard
* @type {process}
*/
this.process = childProcess.fork(path.resolve(this.manager.file), [id, this.manager.shards.size]);
}
}