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

Feature: do not upload when consumer (viewer) is absent #7

Open
ro31337 opened this issue Aug 10, 2024 · 0 comments
Open

Feature: do not upload when consumer (viewer) is absent #7

ro31337 opened this issue Aug 10, 2024 · 0 comments

Comments

@ro31337
Copy link
Contributor

ro31337 commented Aug 10, 2024

We're currently uploading regardless of anyone's watching it.

Imagine user has whole bunch of tabs, and some of these tabs started to hibernate, and hibernation continues on for days. Some people set up sessions and forget about them, they go to sleep, viewer computers go to sleep.

And then user eventually wants to see the session: comes back to work, or browser tab comes back from hibernation.

We should aim to being frugal and minimalistic when it comes to a resource consumption (network, CPU). It's a good thing for client and server parts. So it would be wise to introduce a ping/pong mechanism. And in case of absent pong for more than a minute we shouldn't be uploading, resizing, wasting resources.

However, immediately after a tab comes back from hibernation, we should keep on uploading again.

Initially (when the app starts), we should just upload assuming we've gotten pong.

The underlying mechanism for that is websocket connection, which we already have for cursor tracking - should we reuse it?

@ro31337 ro31337 changed the title Feature: do not upload when consumer is absent Feature: do not upload when consumer (viewer) is absent Aug 10, 2024
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