IShardingManager class abstract
Spawns and contains processes running individual instances of the bot.
The total number of shards, total number of processes and number of shards per process can be manually set, or automatically calculated if token is provided. token can also be set in conjunction with either shardsPerProcess or numProcesses for more control.
Constructors
- IShardingManager.create(ProcessData processData, {int? shardsPerProcess, int? numProcesses, int? totalShards, int? maxGuildsPerShard, int? maxGuildsPerProcess, String? token, ShardingOptions options = const ShardingOptions()})
-
Create a new IShardingManager.
factory
Properties
-
events
→ Stream<
String> -
A stream of events received on this process.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxGuildsPerProcess → int?
-
The maximum number of guilds on a single process.
no setter
- maxGuildsPerShard → int?
-
The maximum number of guilds on a single shard.
no setter
- numProcesses → int?
-
The total number of processes to spawn.
no setter
- options → ShardingOptions
-
The options for this IShardingManager.
no setter
- processData → ProcessData
-
The ProcessData that will be used to spawn the child processes.
no setter
-
processes
→ List<
Process> -
The processes spawned by this IShardingManager.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
The number of shards to spawn in each process.
no setter
- token → String?
-
A Discord bot token used to automatically determine the maximum IDENTIFY concurrency for the bot. If totalShards is not provided, token will also be
used to get the total shard count.
no setter
- totalShards → int?
-
The total number of shards to spawn across all processes.
no setter
Methods
-
broadcast(
String message) → void - Sends a message to all child processes.
-
getCachedChannels(
) → Future< List< int> > -
Fetches the cached channels count from all processes.
inherited
-
getCachedGuilds(
) → Future< List< int> > -
Fetches the cached guilds count from all processes.
inherited
-
getCachedMembers(
) → Future< List< int> > -
Fetches the cached members count from all processes.
inherited
-
getCachedUsers(
) → Future< List< int> > -
Fetches the cached users count from all processes.
inherited
-
getCurrentRss(
) → Future< List< int> > -
Fetches the current RSS from all processes.
inherited
-
getMaxRss(
) → Future< List< int> > -
Fetches the maximum RSS count from all processes.
inherited
-
kill(
[ProcessSignal signal = ProcessSignal.sigterm]) → Future< void> - Kills all child processes.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< void> - Start all the child processes. This is a lengthy operation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited