Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Random after install #4

Closed
lukecarbis opened this issue Jan 5, 2022 · 5 comments
Closed

Random after install #4

lukecarbis opened this issue Jan 5, 2022 · 5 comments

Comments

@lukecarbis
Copy link

It would be really nice if this Tidbyt app continued showing different random Pokemon after being installed on the Tidbyt via the API.

@mackorone
Copy link
Owner

installed on the Tidbyt via the API

I haven't played around with this yet. Can you send me a link to the documentation so that I can repro?

@mackorone
Copy link
Owner

mackorone commented Jan 6, 2022

I just some digging and it looks like the image needs to be periodically updated via a request to Tidbyt's API per user:

That approach won't scale for Tidbyt, right? @rohansingh, @betterengineering, any thoughts? Are you planning on removing Tidbyt servers from the critical path? If not, rate limits are inevitable, right? How are you planning on supporting the quadratic growth of (users * apps)?

@mackorone
Copy link
Owner

One thought: images don't need to be unique per user. The train schedule is the same for everyone, so is the word of the day. People won't care if their random Pokemon is the same as everyone else's. You only need to render the image once, and you can push that one rendered image to all N devices. In doing so, you'd spare you own API and also avoid hammering upstream APIs once per user.

Actually, now that I think about it, this is probably how first class apps work...

@rohansingh
Copy link

@mackorone Yup that's exactly how first-party apps work.

We actually have two resource constraints, compute and bandwidth (egress). Even in a degenerate case where every user has a different image though, it's still not quadratic growth since we only need to render and send things when they are about to be displayed. So even in the worst case, compute and bandwidth scale linearly with the number of devices. In practice it's sub-linear since a lot can be cached and reused.

@lukecarbis Currently when something is pushed via the API, it's just a single rendered image or animation that gets pushed. To update it, you have to keep continuously pushing from a computer. We are however working on a community repo for apps, which will be able to run continuously on our servers.

@mackorone
Copy link
Owner

This commit added the Pokedex app to the community repo: tidbyt/community@9903efb

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

No branches or pull requests

3 participants