Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes the shard shutdown via the Context. This works by setting a "shutdown" field on the Shard struct as being true, indicating that the Shard has shutdown. The Shard Runner detects this and requests a shutdown from the Shard Manager. The ideal solution here would be to add a "Shutdown" variant to serenity::gateway::ConnectionStage, but that would be a breaking change, so we instead need to opt for adding a new struct to gateway::Shard. The Shard Manager has also been updated to only attempt the shutdown of a shard if it doesn't already know for certain that it shut itself down, which avoids an error logged saying that there was an error sending a shutdown message to its Shard Runner. When all shards have been shutdown (for most bots, this will only be one), the Shard Manager will end and the Client will stop its operations, returning thread control to the user.
- Loading branch information
Zeyla Hellyer
committed
Oct 29, 2017
1 parent
d50b129
commit 3616585
Showing
4 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters