Module Ketrew.Engine.Run_automaton

module Run_automaton: sig .. end

type step_allowed_errors = [ `Database of Persistent_data.Error.database
| `List of step_allowed_errors list ]
This type represents the errors that are allowed to escape the Ketrew.Engine.Run_automaton.step function.

Those errors are so fatal that the engine should not really continue: the database is not responding, or some data is missing or has a wrong format.

The type system makes sure that all other errors are dealt with by the state machine.

val step : Ketrew.Engine.t ->
(bool, step_allowed_errors)
Unix_io.Deferred_result.t
Run one step of the engine; step returns true if something happened.
val fix_point : Ketrew.Engine.t ->
([ `Steps of int ], step_allowed_errors)
Unix_io.Deferred_result.t
Run Ketrew.Engine.Run_automaton.step many times until nothing happens or nothing “new” happens.
val try_to_fix_step_error : Ketrew.Engine.t ->
info:string ->
step_allowed_errors ->
(unit,
[> `Database of Persistent_data.Error.database
| `Not_fixable of step_allowed_errors ])
Unix_io.Deferred_result.t