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

Request Multiple Participants #59

Open
stjohnjohnson opened this issue Oct 5, 2022 · 1 comment
Open

Request Multiple Participants #59

stjohnjohnson opened this issue Oct 5, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@stjohnjohnson
Copy link

I'm building a Twitch app that can write to the chat when donations to a participant or team show up. The frequency I was thinking of is checking every minute (since folks are watching live).

While I'm designing this implementation, I'm nervous about making too many calls to the DonorDrive API. If I'm keeping it simple, I need to check the latest values of https://www.extra-life.org/api/participants/X/donations every minute. But I would need to make this call for each participant/team that wants to use my app.

If we have 50 different twitch streams, I then need to make 50 calls per minute. And that's just if I'm only supporting the call to donations. At some point I'd love to post to chat when a milestone is reached (adding another call to /milestones for each participant/twitch stream), but that would put me to 100 calls per minute.

Is there a way to support requesting 2+ participant per call? Like a batch request?

@timmixell timmixell added the enhancement New feature or request label Oct 14, 2022
@timmixell
Copy link
Contributor

Hi @stjohnjohnson , sorry for the delay in getting back to you.

If you're primarily interested in donation updates, you could poll the Team's donations endpoint (check Team DonorDrive progress) on a 15-30 second interval.

When you detect donations you haven't encountered before, lazy load the associated participant(s), and their milestones. Note: participants aren't usually going to have a ton of volatility, so you could maybe get away with just loading participants/milestones once for the duration of the app's lifecycle, or have some kind of counter to manage the frequency that you're checking on any given participant. You'll have to queue that work somehow, or you will get rate-limited.

Hope this helps!

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

No branches or pull requests

2 participants