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

How to consume Rest API scoped? #2972

Open
imerzan opened this issue Aug 1, 2024 · 0 comments
Open

How to consume Rest API scoped? #2972

imerzan opened this issue Aug 1, 2024 · 0 comments

Comments

@imerzan
Copy link

imerzan commented Aug 1, 2024

Title. Basically I have a web app that gets OAuth authorization from users, and I get an access token for that user (identity/email).

I didn't realize DiscordRestClient is instantiating http clients each time which leads to socket exhaustion. Not to mention the implications for rate limiting.

Is there a way to do this where my scoped api controller can have concurrent access to the rest api across different users?

Otherwise I'd need a singleton, and would have to call Login -> read data -> Logout, before proceeding to the next request which doesn't seem very good, but I'm not seeing an obvious solution here besides rolling my own minimal wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant