- save_state triggers only when a setter of state is called (consult the
State class and it's updated property). This trigger will not be set if an element of a list in state is altered (e.g. self._state["my_list"][3] = val").
- save_state could be incorporated in the
IsDaemon.close method, to ensure state is saved at shutdown
I would do it in shutdown, not close (because many daemons that have a close do not call super because it is a no-op)
We actually do explicitly save the state in shutdown_all, but that is only used on POSIX systems, not windows...
Stateclass and it'supdatedproperty). This trigger will not be set if an element of a list in state is altered (e.g.self._state["my_list"][3] = val").IsDaemon.closemethod, to ensure state is saved at shutdownI would do it in shutdown, not close (because many daemons that have a close do not call super because it is a no-op)
We actually do explicitly save the state in shutdown_all, but that is only used on POSIX systems, not windows...