Handler API#
Handlers in mmodel represent different execution methods for the provided
graph. Currently, all handlers are executed in topological order,
inherited from TopologicalHandler.
Handler class#
There are three required elements of a handler class/instance:
The handler should take “graph” and “returns” as two (and only) positional arguments.
The handler should define
__signature__withinspect.Signatureobject to allow signature detection withinspect.signature.The resulting handler object should be callable.
Modify the Model class if these conditions cannot be satisfied.
Handler data class and TopologicalHandler#
Handler data stores the input value and all return values of the node execution.
To define a custom handler, a Data class should be defined,
and it should have __getitem__ and __setitem__ methods.
If the handler inherits from TopologicalHandler, the Data class should be
defined as the handler’s data class.
See handler reference for the handler reference.