Package com.mewna.catnip.shard.manager
Interface ShardCondition
public interface ShardCondition
A shard condition is an async function that determines whether or not the
current shard manager instance can start sharding, ie. all shard conditions
must be
true
for the shard manager to start shards.- Since:
- 11/14/18.
- Author:
- amy
-
Method Summary
Modifier and TypeMethodDescriptionvoid
postshard
(int shardId, ShardConnectState state) Run once sharding has finished.io.reactivex.rxjava3.core.Single<Boolean>
preshard
(int shardId) Get the future for this shard condition.
-
Method Details
-
preshard
Get the future for this shard condition. This function is called ASYNCHRONOUSLY and must be ASYNCHRONOUS to avoid blocking the event loop threads.This is run prior to sharding.
- Parameters:
shardId
- The id of the shard being connected.- Returns:
- The future for this shard condition.
-
postshard
Run once sharding has finished. This function is called SYNCHRONOUSLY.- Parameters:
shardId
- The id of the shard that was connected.state
- The state the shard connected with.
-