arikawa/gateway
diamondburned 6c332ac145 {Voice,}Gateway: Fixed various race conditions
This commit fixes race conditions in both package voice, package
voicegateway and package gateway.

Originally, several race conditions exist when both the user's and the
pacemaker's goroutines both want to do several things to the websocket
connection. For example, the user's goroutine could be writing, and the
pacemaker's goroutine could trigger a reconnection. This is racey.

This issue is partially fixed by removing the pacer loop from package
heart and combining the ticker into the event (pacemaker) loop itself.

Technically, a race condition could still be triggered with care, but
the API itself never guaranteed any of those. As events are handled
using an internal loop into a channel, a race condition will not be
triggered just by handling events and writing to the websocket.
2020-10-22 10:47:27 -07:00
..
commands.go Gateway: GuildSubscribeData should omit empty Channels map 2020-10-17 03:18:50 -07:00
events.go Gateway: Clarified GuildMemberListGroup.ID docs 2020-08-14 21:13:48 -07:00
events_map.go Gateway: Added Relationship events and handlers; minor reformatting 2020-07-11 00:02:57 -07:00
gateway.go {Voice,}Gateway: Fixed various race conditions 2020-10-22 10:47:27 -07:00
identify.go Gateway: Added intent helpers and more context API support 2020-07-11 12:50:32 -07:00
integration_test.go Heart: Better synchronization on close methods 2020-07-30 12:44:50 -07:00
op.go {Voice,}Gateway: Fixed various race conditions 2020-10-22 10:47:27 -07:00
ready.go Gateway: GuildFolderID is now a signed int because Discord 2020-08-19 21:54:20 -07:00
sequence.go Fixed some race conditions 2020-02-02 14:12:54 -08:00
shards.go WIP integration test 2020-01-14 23:34:18 -08:00