mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
Update sharding docs some more
This commit is contained in:
parent
975da5f1a5
commit
1338e9bd8e
2 changed files with 8 additions and 6 deletions
|
|
@ -6,7 +6,9 @@ const { Error } = require('../errors');
|
|||
const delayFor = require('util').promisify(setTimeout);
|
||||
|
||||
/**
|
||||
* A self-contained shard spawned by the {@link ShardingManager}.
|
||||
* A self-contained shard created by the {@link ShardingManager}. Each one has a {@link ChildProcess} that contains
|
||||
* an instance of the bot and its {@link Client}. When its child process exits for any reason, the shard will spawn a
|
||||
* new one to replace it as necessary.
|
||||
* @extends EventEmitter
|
||||
*/
|
||||
class Shard extends EventEmitter {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ const delayFor = require('util').promisify(setTimeout);
|
|||
|
||||
/**
|
||||
* This is a utility class that makes multi-process sharding of a bot an easy and painless experience.
|
||||
* It works by spawning a self-contained {@link ChildProcess} for each individual shard, each containing its own client.
|
||||
* They all have a line of communication with the master process, and there are several useful methods that utilise
|
||||
* it in order to simplify tasks that are normally difficult with multi-process sharding. It can spawn a specific number
|
||||
* of shards or the amount that Discord suggests for the bot, and takes a path to your main bot script to launch for
|
||||
* each one.
|
||||
* It works by spawning a self-contained {@link ChildProcess} for each individual shard, each containing its own
|
||||
* instance of your bot's {@link Client}. They all have a line of communication with the master process, and there are
|
||||
* several useful methods that utilise it in order to simplify tasks that are normally difficult with sharding. It can
|
||||
* spawn a specific number of shards or the amount that Discord suggests for the bot, and takes a path to your main bot
|
||||
* script to launch for each one.
|
||||
* @extends {EventEmitter}
|
||||
*/
|
||||
class ShardingManager extends EventEmitter {
|
||||
|
|
|
|||
Loading…
Reference in a new issue