def open
import bend-kit-runner@0.13.0.1/runner.bend as Runnerimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-journal@0.3.0.1/journal.bend as J
1799# Opens the runner at path: replays its journal into the state, then requeues each ticket that was running.
1800# capacity bounds the attempts that run at once. max caps an op record's octets; limit caps the journal file and a snapshot.
1801# Fails when the journal fails to open, or a committed record is not a snapshot or an op.
1802def open(~A: Data, ~penc: A -> Bytes.Bytes, ~pdec: Bytes.Bytes -> Maybe<&2, A>, +path: String, +max: U32, +limit: U32, c: Config, +capacity: Nat) -> IO(Out(Runner<A>)):
1803 do IO<Out(Runner<A>)>:
1804 x : Out(J.Journal & Maybe<&2, State<A>>) <- J.open(~Maybe<&2, State<A>>, ~(acc => b => replay.step(~A, ~pdec, acc, b)), path, limit, limit, Some{new(A)})
1805 open.got(~A, ~penc, x, max, path, limit, c, capacity)
Uses (17)
Used by (0)
No other definition uses this definition.