-
-
Notifications
You must be signed in to change notification settings - Fork 4k
refactor: remove timer utilities from Client #6113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove timer utilities from Client #6113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really okay to not clear at least the intervals anymore?
A destroyed client will now continue sending typing start requests.
(As well as sweep messages and handlers, but those don't hit up Discord's api)
Fixed with #6114 😄
Assigned the relevant intervals and calling clear on them since the last commit, good catch 👍🏼 |
This needs a rebase. |
77de634
to
46d8bfd
Compare
Done, @iCrawl |
Please describe the changes this PR makes and why it should be merged:
BaseClient#setTimeout
BaseClient#setInterval
BaseClient#setImmediate
BaseClient#clearTimeout
BaseClient#clearInterval
BaseClient#clearImmediate
Why?
The aforementioned methods existed to make timers not hang the process when it's destroyed and nothing else kept the process on (from the user's side). Since all timers have an
unref
method (Immediate#unref
,Immediate#unref
), there is not longer a need to keep and track those timers, which can potentially lead to memory leaks.Status and versioning classification: