ducky.interfaces module¶
-
class
ducky.interfaces.IMachineWorker[source]¶ Bases:
objectBase class for objects that provide pluggable service to others.
-
boot(*args)[source]¶ Prepare for providing the service. After this call, it may be requested by others.
-
die(exc)[source]¶ Exceptional state requires immediate termination of service. Probably no object will ever have need to call others’
diemethod, it’s intended for internal use only.
-
halt()[source]¶ Terminate service. It will never be requested again, object can destroy its internal state, and free allocated resources.
-
-
class
ducky.interfaces.ISnapshotable[source]¶ Bases:
objectBase class for objects that can be saved into a snapshot.
-
load_state(state)[source]¶ Restore state of the object.
Parameters: state (ducky.snapshot.SnapshotNode) – snapshot node containing saved state.
-
save_state(parent)[source]¶ Create state of the object, and attach it to a parent snapshot node.
Parameters: parent (ducky.interfaces.ISnapshotable) – parent snapshot node.
-