Kira v0.1.0 Kira.RuntimeState
Link to this section Summary
Functions
Records the fact that the process has started running, and also prevents any of the branches that depend on it from start rolling back
When you record a failure with a branch it doesn’t necessary mean this process has completely failed, as there is an oppurtunity for it to be reattmpted. But it is important for the exception to be recorded, so if a rollback is necessary we can identify the culprit that made the rollback necessary
Ensure anything that would be awaiting for this task to be rolled back is no longer blocked by the task associated with this branch_name
Link to this section Types
t() :: %Kira.RuntimeState{
branch_states: branches(),
config: any(),
progress: Kira.Progress.t(),
running: running(),
timeout: timeout()
}
Link to this section Functions
create(config :: any(), branch_list :: [Kira.Branch.t()], timeout :: timeout()) :: Kira.Util.result(t())
get_branch(state :: t(), branch_name :: atom()) :: Kira.Util.result(Kira.BranchState.t())
get_branch_from_pid(state :: t(), pid :: pid()) :: Kira.Util.result(Kira.BranchState.t())
get_branch_pid(state :: t(), branch_name :: atom()) :: Kira.Util.result(pid())
mark_as_applied(state :: t(), branch_name :: atom(), value :: any()) :: Kira.Util.result(t())
mark_as_applying(state :: t(), branch_name :: atom(), pid :: pid()) :: Kira.Util.result(t())
Records the fact that the process has started running, and also prevents any of the branches that depend on it from start rolling back.
mark_as_unapplied(state :: t(), branch_name :: atom()) :: Kira.Util.result(t())
record_apply_retry(state :: t(), branch_name :: atom(), pid :: pid()) :: Kira.Util.result(t())
record_failure(state :: t(), branch_name :: atom(), error :: any()) :: Kira.Util.result(t())
When you record a failure with a branch it doesn’t necessary mean this process has completely failed, as there is an oppurtunity for it to be reattmpted. But it is important for the exception to be recorded, so if a rollback is necessary we can identify the culprit that made the rollback necessary.
resolve_dependencies_of(state :: t(), branch_name :: atom()) :: Kira.Util.result(map())
set_branch_task( state :: t(), branch_name :: atom(), task :: Kira.BranchState.task() ) :: Kira.Util.result(t())
unblock_dependend_unapplys(state :: t(), branch_name :: atom()) :: Kira.Util.result(t())
Ensure anything that would be awaiting for this task to be rolled back is no longer blocked by the task associated with this branch_name.