feat: deprecated shard
This commit is contained in:
@@ -3,8 +3,11 @@
|
|||||||
// "Root" classes (starting points)
|
// "Root" classes (starting points)
|
||||||
exports.BaseClient = require('./client/BaseClient');
|
exports.BaseClient = require('./client/BaseClient');
|
||||||
exports.Client = require('./client/Client');
|
exports.Client = require('./client/Client');
|
||||||
|
/** @deprecated This will be removed in the next major version */
|
||||||
exports.Shard = require('./sharding/Shard');
|
exports.Shard = require('./sharding/Shard');
|
||||||
|
/** @deprecated This will be removed in the next major version */
|
||||||
exports.ShardClientUtil = require('./sharding/ShardClientUtil');
|
exports.ShardClientUtil = require('./sharding/ShardClientUtil');
|
||||||
|
/** @deprecated This will be removed in the next major version */
|
||||||
exports.ShardingManager = require('./sharding/ShardingManager');
|
exports.ShardingManager = require('./sharding/ShardingManager');
|
||||||
exports.WebhookClient = require('./client/WebhookClient');
|
exports.WebhookClient = require('./client/WebhookClient');
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ let Worker = null;
|
|||||||
* an instance of the bot and its {@link Client}. When its child process/worker exits for any reason, the shard will
|
* an instance of the bot and its {@link Client}. When its child process/worker exits for any reason, the shard will
|
||||||
* spawn a new one to replace it as necessary.
|
* spawn a new one to replace it as necessary.
|
||||||
* @extends {EventEmitter}
|
* @extends {EventEmitter}
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
class Shard extends EventEmitter {
|
class Shard extends EventEmitter {
|
||||||
constructor(manager, id) {
|
constructor(manager, id) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const Util = require('../util/Util');
|
|||||||
/**
|
/**
|
||||||
* Helper class for sharded clients spawned as a child process/worker, such as from a {@link ShardingManager}.
|
* Helper class for sharded clients spawned as a child process/worker, such as from a {@link ShardingManager}.
|
||||||
* Utilises IPC to send and receive data to/from the master process and other shards.
|
* Utilises IPC to send and receive data to/from the master process and other shards.
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
class ShardClientUtil {
|
class ShardClientUtil {
|
||||||
constructor(client, mode) {
|
constructor(client, mode) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const Util = require('../util/Util');
|
|||||||
* with sharding. It can spawn a specific number of shards or the amount that Discord suggests for the bot, and takes a
|
* 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.
|
* path to your main bot script to launch for each one.
|
||||||
* @extends {EventEmitter}
|
* @extends {EventEmitter}
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
class ShardingManager extends EventEmitter {
|
class ShardingManager extends EventEmitter {
|
||||||
/**
|
/**
|
||||||
|
|||||||
3
typings/index.d.ts
vendored
3
typings/index.d.ts
vendored
@@ -2868,6 +2868,7 @@ export interface ShardEventTypes {
|
|||||||
message: [message: any];
|
message: [message: any];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated This will be removed in the next major version */
|
||||||
export class Shard extends EventEmitter {
|
export class Shard extends EventEmitter {
|
||||||
private constructor(manager: ShardingManager, id: number);
|
private constructor(manager: ShardingManager, id: number);
|
||||||
private _evals: Map<string, Promise<unknown>>;
|
private _evals: Map<string, Promise<unknown>>;
|
||||||
@@ -2906,6 +2907,7 @@ export class Shard extends EventEmitter {
|
|||||||
): this;
|
): this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated This will be removed in the next major version */
|
||||||
export class ShardClientUtil {
|
export class ShardClientUtil {
|
||||||
private constructor(client: Client, mode: ShardingManagerMode);
|
private constructor(client: Client, mode: ShardingManagerMode);
|
||||||
private _handleMessage(message: unknown): void;
|
private _handleMessage(message: unknown): void;
|
||||||
@@ -2937,6 +2939,7 @@ export class ShardClientUtil {
|
|||||||
public static shardIdForGuildId(guildId: Snowflake, shardCount: number): number;
|
public static shardIdForGuildId(guildId: Snowflake, shardCount: number): number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated This will be removed in the next major version */
|
||||||
export class ShardingManager extends EventEmitter {
|
export class ShardingManager extends EventEmitter {
|
||||||
public constructor(file: string, options?: ShardingManagerOptions);
|
public constructor(file: string, options?: ShardingManagerOptions);
|
||||||
private _performOnShards(method: string, args: unknown[]): Promise<unknown[]>;
|
private _performOnShards(method: string, args: unknown[]): Promise<unknown[]>;
|
||||||
|
|||||||
Reference in New Issue
Block a user