Open anandology opened 3 years ago
It would be a good idea to generalize the stream concept further to support multiple streams. Regular executions will either have an io stream or no streams. Graphical applications like the ones that paint on canvas etc. can have additional stream to communicate the keyboard board and mouse events to the program and receive the commands to paint.
Currently the executing the code is done as part of the websocket connection. If the connection gets lost, there is no way to reconnect. This is an improvement over protocol v0.1 by adding the concept of sessions.
Protocol
The LiveCode manages sessions of execution. A new session is created by sending a POST request to
/sessions
and each session info can be get by sending aGET
request to/sessions/session-id
.List all sessions of the current user
This will be implemented only after adding support for users.
Create a new session
The
stream
link provides the websocket connection for receiving the output and events .Delete a session
Possible Error codes:
Connection to the stream
If the connection to a websocket is lost, connection can be retried.
The behaviour of multiple websocket clients connecting at the same time is undefined.
The stream websocket protocol
The stream websocket protocol will be save as in the LiveCode protocol 0.1, except that there won't be any
exec
command.