Skip to content

Commit

Permalink
use event emitters to dispatch incoming gateway events (#14)
Browse files Browse the repository at this point in the history
* Migrate READY handling to a separate file

In preparation for moving all high-level gateway event handling to a
separate location, move the code handling the READY event into a
separate file.

Ultimately, I'm not too sure that converting class methods into exported
free functions is the best idea, especially since they take an instance
of the class and mutate it to boot---but the class itself was getting
pretty long and it made the file a bit difficult to navigate.

* Listen for gateway events via EventEmitter

Naively move all code handling gateway events into subscriber functions
that attach to an EventEmitter for better organization. Better types are
pending.

* Merge gateway event handling into a single file

Less tab juggling in the text editor, while remaining easier to
navigate. Less import churn too.

* report gateway event handler errors to sentry

Co-authored-by: Kishan Bagaria <[email protected]>

---------

Co-authored-by: Kishan Bagaria <[email protected]>
  • Loading branch information
slice and KishanBagaria authored Dec 23, 2023
1 parent b310e9c commit fd78a8d
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 548 deletions.
Loading

0 comments on commit fd78a8d

Please sign in to comment.