DevTools/Actor Best Practices
< DevTools
Some aspects of front and actor design can be tricky to understand, even for experienced engineers. The following are several best practices you should keep in mind when adding new actors and fronts.
Actor should clean up itself, don't wait for the client
In the past, some actors would wait for the client to send a "you are done now" message when the toolbox closes to shutdown the actor. This seems reasonable at first, but keep in mind that the connection can disappear at any moment. It may not be possible for the client to send this message.
A better choice is for the actor to do all clean up itself when it's notified that the connection goes away. Then there's no need for the client to send any clean up message, and we know the actor will be in a good state no matter what.