| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
The names of environment variable tokens in the examples differed, so
this makes them all use the same name.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
In addition to making the threadpool used by client shards customizable
by the user, make only a single threadpool (as opposed to one per shard)
and share it across all shards.
|
| |
|
|
|
|
| |
A threadpool will help with giving event dispatches a threaded behaviour
while still allowing the library the ability to perform other actions,
such as receiving new events and heartbeating over the websocket client.
|
| | |
|
| | |
|
| |
|
|
|
| |
`ShardRunner::recv_events` actually only receives one event, so
de-pluralize it.
|
| |
|
|
|
|
|
|
|
|
| |
Improve shard logic by more cleanly differentiating when resuming, as
well as actually fixing resume logic.
For shard runners, better handling of dead clients is added, as well as
more use of the shard manager, in that the runner will now more
liberally request a restart when required (instead of sitting and doing
nothing infinitely).
|
| | |
|
| |
|
|
|
|
| |
Due to the new ShardManager, `Client::shards` would never fill, so
instead clone the `shard_runners` instance from the `ShardManager` to
the `Client`.
|
| | |
|
| | |
|
| |
|
|
| |
The shard manager will queue up shards for booting.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When spawning multiple shards (via an equal number of futures - one
per shard) joined on a core.run use, the very first future executed
would block forever due to a sync, blocking `monitor_shard` use. While
this defeats the purpose of tokio, this was meant to be a first step to
an async serenity implementation.
To "fix" this blocking call until a deeper async implementation is made,
spawn a new thread per tokio core (and thus per shard). This causes the
same expected behaviour, just with multiple threads like before.
|
| | |
|
| |
|
|
|
| |
This fixes compilation errors and warnings when compiling a mixture of
non-default feature targets.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Add a HashMap which contains the shards, keyed by the shard ID with the
value as the shard. This allows for manual interaction outside of event
handlers.
|
| | |
|
| | |
|
| |
|
|
| |
Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The framework is now moved in its entirity to the `framework` module,
with the `Framework` trait currently on its own and the builtin
implementation provided.
The builtin implementation has been renamed to "Standard".
Upgrade path:
Rename the `BuiltinFramework` import to `StandardFramework`. Instead of
importing builtin framework items from `serenity::framework`, import
them from `serenity::framework::standard`.
This is the beginning to #60. The root `framework` module (non-standard
implementation) will be built more by the time it's closed.
|
| | |
|
| | |
|
| |
|
|
| |
note: This trait might become like `framework::Framework` in the future.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This project has - in the past - used an indentation style of 4 spaces,
without trailing whitespace. This commit modifies lines with tab
indentation to 4 spaces.
Whether to use tabs or spaces is up to the current maintainer, but
consistency avoids files eventually being completely mixed styles.
|
| | |
|
| |
|
|
| |
builtin-framework is turned off
|
| | |
|
| |
|
|
| |
Removed action support from the builtin one as well, due to it adding some uneccassery complexity and it being only asked upon by one user
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|