sourcebots / robot-api

(Legacy) API to interface with robotd
http://docs.sourcebots.co.uk/api/
MIT License
4 stars 1 forks source link

Rework robotd JSON connections #78

Open PeterJCLaw opened 6 years ago

PeterJCLaw commented 6 years ago

This is an attempt to both simplify the logic around the JSON sockets connecting robot-api to robotd and to prepare their usage for having type hints added.

The main unknown I'm facing is not really understanding what real-world scenarios each of the exceptions we currently catch relate to, and thus whether there is anything sensible that we can do in each case.

This branch begins to assume that if we reconnect a socket that we should recommence our instruction cycle with the backend, though doesn't apply this consistently. It's not clear to me how reliable this expectation is; in particular how it affect reconnections which occur in the middle of _send_and_receive.

Goals

PeterJCLaw commented 6 years ago

@kierdavis thanks! This is definitely in need of some actual testing, as well as a better understanding of some of the errors it's now letting bubble straight away.

I'll update the description to clarify my goals as I think there's an even better way of managing the connections, that we've just not yet found.