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

Add broadcast API aka watch support #12

Open
SUPERCILEX opened this issue Jul 19, 2024 · 2 comments
Open

Add broadcast API aka watch support #12

SUPERCILEX opened this issue Jul 19, 2024 · 2 comments

Comments

@SUPERCILEX
Copy link
Owner

Add a way for clients to be notified when anything changes. Ideally the API tells you what changed but probably also needs an escape hatch to say "eh, dunno reload everything" for garbage collection for example. Previous notes: #3

@SUPERCILEX
Copy link
Owner Author

SUPERCILEX commented Jul 28, 2024

For the UI to be efficient, I think we need to subscribe to server broadcasts while visible, drop the connection while in the background, and statx every bucket and ring with a full reload when back in the foreground. Since the server doesn't store a log of operations, there's no way to efficiently generate a diff between two random points in time. Also when reconnecting to the server we need to subscribe to changes before doing a full refresh to avoid the case where the server GCs as we refresh.

@SUPERCILEX SUPERCILEX changed the title Add broadcast API Add broadcast API aka watch support Aug 6, 2024
@SUPERCILEX
Copy link
Owner Author

Something I just realized: for the watcher clients, they don't need to differentiate between requests and pushes. If you request an add for example, it'll show up in your event stream just like any other client requesting an add, so there's no speed to special case the receive buffer for your requests vs other people's changes.

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