At this point, most implementations of Machine have a delete method. However, once you call delete, you get an inconsistent state. It probably works to call close on the object, throw it away, and rebuild the object, but there's not infrastructure to do that.
We should come up with a better work flow. Options might include:
Delete triggers an event that causes the model to throw away its machine implementation and the next reference will recreate. This would only work with modeling classes, and I'm not sure how it would work when the Machine propagates up to higher level injectors.
A standardized recreate interface that would recreate the machine, and call run_setup_tasks again
Cause the model to no longer be async_ready and have async_become_ready recreate the machine.
cc: @kdienes for bringing up the issue. Also see dd8196b90ae792af0 makes this more likely because it makes it easy to delete a machine.
At this point, most implementations of Machine have a delete method. However, once you call delete, you get an inconsistent state. It probably works to call close on the object, throw it away, and rebuild the object, but there's not infrastructure to do that. We should come up with a better work flow. Options might include:
cc: @kdienes for bringing up the issue. Also see dd8196b90ae792af0 makes this more likely because it makes it easy to delete a machine.