Open teh-cmc opened 2 weeks ago
And now that I'm documenting the application model (#919), I'm realizing that doing this would provide a level of consistency that would allow me to concisely state:
rr.spawn(serve=False) = rerun &
rr.spawn(serve=True) = rerun --serve &
and that would be very nice.
Users want to be able to log to the web-viewer from multiple processes, just like they do with the native viewer.
This requires an intermediate proxy, so all the data can go through a single websocket port, which the web-viewer then knows to poll. The solution today is to manually start a tcp+websocket server with
rerun --serve
, then just userr.connect()
in all your clients.That manual step is annoying, and AFAICT, could be automated away by augmenting
rr.spawn()
.All
rr.spawn()
does is basicallyfork_exec("rerun --port={port}")
. We could add an extraserve: bool
parameter, and thenrr.spawn(serve=True)
would bottom out infork_exec("rerun --port={port} --serve")
. Assuming our usual policy of "silently re-use the existing instance in case of conflicted ports", that means every client could just callrr.spawn(serve=True)
and voila, all the processes are logging to the same web-viewer.Related:
7766