-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Train status web interface #141
base: master
Are you sure you want to change the base?
Train status web interface #141
Conversation
@karpathy any thoughts on this? |
What is the downside of having the JS code request an update vs streaming directly to client? Also, nice job. I had a hard time finding a way to use JSON since I'm less experienced with Lua, but you seemed to have solved the problem. |
Slight overhead - isn't noticeable amount though. It's just unnecessary to have a request & response rather than streaming responses after handshake. |
This builds upon #82 and uses lua-websockets to have a websocket server running if
-visualization
flag is enabled (enabling also sets the port for which the server is to run). Instead of using files the initial data is sent when a connection is initiated, from there every time a client requests an update.. the info on page is updated.I was not able to obtain as clean of a solution as I would have liked due to cross-boundary c-code issues when copas yields, the downside of this is we currently must call update on client side prior to receiving the data (whereas I had hoped to stream it with no need to request past initial connection). Perhaps in future this can be solved but someone more knowledgeable.
All dependencies on js/css side are also now local, in case user is not connected to internet.
All settings were default other than gpu while testing, it would probably be smart to check with gpu enabled for a few minutes just in case any magical bugs sprout from the depths of hell.