Skip to content
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

feat(Client): add global sweepers #6825

Merged
merged 12 commits into from Dec 15, 2021
Merged

Conversation

ckohen
Copy link
Member

@ckohen ckohen commented Oct 13, 2021

Please describe the changes this PR makes and why it should be merged:

⚠️ This is tested, but not all combinations of sweepers have been validated.
  • This aims to tackle point 2 in Roadmap: cache and sweeping improvements #6539: Global Sweepers. This does not completely satisfy what was outlined there however, it still relies on LimitedCollection to provide max size functionality. After doing the work to get to this point, that seemed out of scope, and can easily be tackled in another PR. This does mean that you are still storing extra properties on LimitedCollection for now, however hopefully not tracking a timeout.

In order to keep this semver: minor, default options have unfortunately not been switched to use the sweepers in this PR.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance..this looks awesome!

src/client/Client.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
src/client/Client.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things, nice work overall ^^

src/util/Sweepers.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
ckohen and others added 7 commits December 9, 2021 02:24
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>
Co-Authored-By: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-Authored-By: Almeida <almeidx@pm.me>
ckohen and others added 2 commits December 9, 2021 02:24
Co-Authored-By: Antonio Román <kyradiscord@gmail.com>
kyranet
kyranet previously requested changes Dec 9, 2021
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the last 2 requests, everything else looks fine to me.

src/util/Sweepers.js Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
src/util/Options.js Show resolved Hide resolved
@iCrawl iCrawl modified the milestones: Version 13.x, Version 13.4 Dec 13, 2021
Copy link
Member

@SpaceEEC SpaceEEC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the importance of the count bits, but here they are. 😅

src/util/Sweepers.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
src/util/Sweepers.js Outdated Show resolved Hide resolved
Co-Authored-By: Antonio Román <kyradiscord@gmail.com>
@iCrawl iCrawl merged commit d1ef2f5 into discordjs:main Dec 15, 2021
@ckohen ckohen deleted the global-sweepers branch December 16, 2021 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants