def tick

bend-kit-runner@0.13.0.1 · runner.bend:1627

import bend-kit-runner@0.13.0.1/runner.bend as Runner
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-retry@0.3.0.0/retry.bend as Retry

1627# One round: start an attempt for each due ticket the pool admits. Then read the inbox: as each attempt finishes, record its outcome,
1628# return its unit, and start the next due ticket in that unit; append and answer each ask from another fiber.
1629# The round ends when no attempt runs and the inbox is empty. Then compact the journal when it grew past Config.compact.
1630# Done{True} when an attempt ran or an ask was answered. work runs on its own; target names the breaker that guards it.
1631def tick(~A: Data, ~penc: A -> Bytes.Bytes, ~target: A -> String, ~work: A -> IO(Retry.Outcome), r: Runner<A>) -> IO(Runner<A> & Out(Bool)):
1632  do IO<Runner<A> & Out(Bool)>:
1633    now : Nat <- clock()
1634    t : Runner<A> & Out(Bool) <- tick.at(~A, ~penc, ~target, ~work, now, r)
1635    tick.grown(~A, ~penc, t)

Uses (13)

Used by (1)