docs(sharding): ShardingManager#createShard doesn't spawn the s… (#3875)

* Fixed createShard() to show an example!

* docs(ShardingManager): clarify createdShard docs

* docs(Shard): clarify manager parameter

* docs(ShardingManager): use an info tag for createShard's param

Co-Authored-By: Sugden <28943913+NotSugden@users.noreply.github.com>

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
Spooder
2020-03-07 00:00:11 -05:00
committed by GitHub
parent 61ef46ff30
commit b5a7e5cdf0
2 changed files with 6 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ let Worker = null;
*/ */
class Shard extends EventEmitter { class Shard extends EventEmitter {
/** /**
* @param {ShardingManager} manager Manager that is spawning this shard * @param {ShardingManager} manager Manager that is creating this shard
* @param {number} id ID of this shard * @param {number} id ID of this shard
*/ */
constructor(manager, id) { constructor(manager, id) {

View File

@@ -143,10 +143,11 @@ class ShardingManager extends EventEmitter {
} }
/** /**
* Spawns a single shard. * Creates a single shard.
* @param {number} [id=this.shards.size] ID of the shard to spawn - * <warn>Using this method is usually not necessary if you use the spawn method.</warn>
* **This is usually not necessary to manually specify.** * @param {number} [id=this.shards.size] ID of the shard to create
* @returns {Shard} * <info>This is usually not necessary to manually specify.</info>
* @returns {Shard} Note that the created shard needs to be explicitly spawned using its spawn method.
*/ */
createShard(id = this.shards.size) { createShard(id = this.shards.size) {
const shard = new Shard(this, id); const shard = new Shard(this, id);