Closed renkun-ken closed 4 years ago
Looks the current check interval specified at https://github.com/nx10/httpgd/blob/master/inst/www/index.html#L63 is too large. I tried 50 and it is very responsive now and I don't observe noteable difference of resource consumption.
Does it make sense to change this value to a much lower value than 1500 to make it responsive?
I am currently working on implementing websockets to push changes as soon as they occur from the server to the client. This should lower resource consumption and eliminate any delay.
I'm not sure if websockets could work in VSCode WebView especially in a remote development environment due to port forwarding not working for websockets (see https://github.com/microsoft/vscode/issues/74085).
Good to know. I will keep a way to check for events in an interval via HTTP for environments where websockets are not available.
With the latest commit, the check interval 500 looks much more reponsive now. Thanks!
I'm using the following code to test:
When the first
plot
is called, the webpage is updated roughly more than 1 second later. And the same occurs with theabline
call. I'm wondering if it is possible that the live page updates in a more responsive manner?