class documentation
class MethodicalState(object): (source)
A state for a MethodicalMachine.
| Method | upon |
Declare a state transition within the MethodicalMachine associated with this MethodicalState: upon the receipt of the `input`, enter the `state`, emitting each output in `outputs`. |
| Class Variable | machine |
Undocumented |
| Class Variable | method |
Undocumented |
| Class Variable | serialized |
Undocumented |
| Method | _name |
Undocumented |
def upon(self, input:
MethodicalInput, enter: MethodicalState | None = None, outputs: Iterable[ MethodicalOutput] | None = None, collector: Callable[ [ Iterable[ T]], object] = list):
(source)
¶
Declare a state transition within the MethodicalMachine associated with this MethodicalState: upon the receipt of the `input`, enter the `state`, emitting each output in `outputs`.
| Parameters | |
input:MethodicalInput | The input triggering a state transition. |
enter:MethodicalState | None | The resulting state. |
outputs:Iterable[ | The outputs to be triggered as a result of the declared state transition. |
collector:Callable[ | The function to be used when collecting output return values. |
| Raises | |
TypeError | if any of the `outputs` signatures do not match the `inputs` signature. |
ValueError | if the state transition from `self` via `input` has already been defined. |