aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add a threadpool to the shard runnerZeyla Hellyer2017-10-093-27/+56
| | | | | | | | | | | | 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.
| * Generate `Default` for CurrentUser and use it in `Cache::default`acdenisSK2017-10-083-12/+3
| |
| * Add an impl for `&str`acdenisSK2017-10-081-0/+4
| |
| * Find `Member` via substrings, allow case-insensitivity on ↵Lakelezz2017-10-071-4/+54
| | | | | | | | `members_containing` and `members_starting_with` (#184)
| * Add the lifetime againacdenisSK2017-10-071-1/+1
| |
| * Help-commands filtering and Member-prefix-search (#182)Lakelezz2017-10-073-19/+40
| |
| * Make `has_correct_permissions` a free-standing functionacdenisSK2017-10-061-15/+15
| |
| * Fix a typoacdenisSK2017-10-051-1/+1
| |
| * Add an andacdenisSK2017-10-051-1/+1
| |
| * Use an as_ref hackacdenisSK2017-10-056-10/+17
| |
| * Replace slice parametres by IntoIterator (#177)François Triquet2017-10-057-9/+15
| | | | | | Fixes #174
| * Fix most clippy warningsMaiddog2017-10-049-33/+21
| |
| * Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-0411-17/+17
| |
| * Force `I` to be not implemented outside serenityacdenisSK2017-10-031-3/+15
| |
| * Revert "Use the de-generification trick."acdenisSK2017-10-0319-349/+123
| | | | | | | | Makes the compiliation time just a bit worse
| * Use the de-generification trick.acdenisSK2017-10-0219-123/+349
| | | | | | | | Fixes #168
| * `to_owned` -> `to_string`acdenisSK2017-10-0134-176/+176
| |
| * Have `ConnectionStage` derive CopyacdenisSK2017-10-012-6/+6
| | | | | | | | Since it's a fairly simple enum. Also changed `is_connecting` to be more idiomatic.
| * Rename an internal Shard Runner methodZeyla Hellyer2017-09-301-2/+2
| | | | | | | | | | `ShardRunner::recv_events` actually only receives one event, so de-pluralize it.
| * Improve shard logicZeyla Hellyer2017-09-303-113/+168
| | | | | | | | | | | | | | | | | | | | 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).
| * Improve shard and shard runner loggingZeyla Hellyer2017-09-302-60/+99
| |
| * WhoopsacdenisSK2017-09-301-2/+2
| |
| * Add a todoacdenisSK2017-09-301-0/+1
| |
| * Make the internal string publicacdenisSK2017-09-301-1/+1
| |
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-1035-320/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the `parking_lot` crate's implementations of `std::sync::Mutex` and `std::sync::RwLock`, which are more efficient. A writeup on why `parking_lot` is more efficient can be read here: <https://github.com/Amanieu/parking_lot> Upgrade path: Modify `mutex.lock().unwrap()` usage to `mutex.lock()` (not needing to unwrap or handle a result), and `rwlock.read().unwrap()`/`rwlock.write().unwrap()` usage to `rwlock.read()` and `rwlock.write()`. For example, modify: ```rust use serenity::CACHE; println!("{}", CACHE.read().unwrap().user.id); ``` to: ```rust use serenity::CACHE; println!("{}", CACHE.read().user.id); ```
* | Resume on resumable session invalidationsZeyla Hellyer2017-10-092-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Session invalidations include whether the session may be resumable. Previously, this was not parsed by serenity. This data is now contained in `GatewayEvent::InvalidateSession` as a boolean, which constitutes a breaking change for users that manually handle gateway events. Upgrade path: Instead of pattern matching on simply the variant like so: ```rust use serenity::model::event::GatewayEvent; match gateway_event { GatewayEvent::InvalidateSession => { // work here }, // other matching arms here _ => {}, } ``` Instead pattern match it as a single field tuple-struct: ```rust use serenity::model::event::GatewayEvent; match gateway_event { GatewayEvent::InvalidateSession(resumable) => { // work here }, // other matching arms here _ => {}, } ```
* | Make webhook_id a majour parameter in ratelimitingZeyla Hellyer2017-10-092-4/+19
| | | | | | | | | | This change is made due to this change in documentation: <https://github.com/discordapp/discord-api-docs/commit/32d06c360867cead6aa785ff10c437fdb2743bd6?short_path=5f625d6#diff-5f625d6c4303e22c3d6af4c8d6df28fe>
* | Reset shard heartbeat state on resumeZeyla Hellyer2017-10-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When a resume is received, the heartbeat state would not be reset. This state includes: - whether the last heartbeat was acknowledged - when the last heartbeat was sent - when the last heartbeat acknowledgement was received This resulted in the bot re-IDENTIFYing after a Resumed event was received. To fix this issue, reset them when a Resumed event is received.
* | Make the client threadpool user-customizableZeyla Hellyer2017-10-094-15/+38
| | | | | | | | | | | | 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.
* | Add a threadpool to the shard runnerZeyla Hellyer2017-10-093-27/+56
| | | | | | | | | | | | 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.
* | Generate `Default` for CurrentUser and use it in `Cache::default`acdenisSK2017-10-093-12/+3
| |
* | Add an impl for `&str`acdenisSK2017-10-091-0/+4
| |
* | Find `Member` via substrings, allow case-insensitivity on ↵Lakelezz2017-10-091-4/+54
| | | | | | | | `members_containing` and `members_starting_with` (#184)
* | Add the lifetime againacdenisSK2017-10-091-1/+1
| |
* | Help-commands filtering and Member-prefix-search (#182)Lakelezz2017-10-093-19/+40
| |
* | Make `has_correct_permissions` a free-standing functionacdenisSK2017-10-091-15/+15
| |
* | Fix a typoacdenisSK2017-10-091-1/+1
| |
* | Add an andacdenisSK2017-10-091-1/+1
| |
* | Use an as_ref hackacdenisSK2017-10-096-10/+17
| |
* | Replace slice parametres by IntoIterator (#177)François Triquet2017-10-097-9/+15
| | | | | | Fixes #174
* | Fix most clippy warningsMaiddog2017-10-099-32/+20
| |
* | Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-0911-17/+17
| |
* | Force `I` to be not implemented outside serenityacdenisSK2017-10-091-3/+15
| |
* | Revert "Use the de-generification trick."acdenisSK2017-10-0919-346/+117
| | | | | | | | Makes the compiliation time just a bit worse
* | Use the de-generification trick.acdenisSK2017-10-0919-119/+348
| | | | | | | | Fixes #168
* | `to_owned` -> `to_string`acdenisSK2017-10-0934-176/+176
| |
* | Have `ConnectionStage` derive CopyacdenisSK2017-10-092-6/+6
| | | | | | | | Since it's a fairly simple enum. Also changed `is_connecting` to be more idiomatic.
* | Rename an internal Shard Runner methodZeyla Hellyer2017-10-091-2/+2
| | | | | | | | | | `ShardRunner::recv_events` actually only receives one event, so de-pluralize it.
* | Improve shard logicZeyla Hellyer2017-10-093-113/+168
| | | | | | | | | | | | | | | | | | | | 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).
* | Improve shard and shard runner loggingZeyla Hellyer2017-10-092-60/+99
| |