Runner.tick: def of bend-kit-runner@0.13.0.1
Import: import bend-kit-runner@0.13.0.1/runner.bend as Runner
Lines 1627-1635 of bend-kit-runner@0.13.0.1/runner.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-runner@0.13.0.1/runner.bend&start_line=1627&end_line=1635
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
# One round: start an attempt for each due ticket the pool admits. Then read the inbox: as each attempt finishes, record its outcome,
# return its unit, and start the next due ticket in that unit; append and answer each ask from another fiber.
# The round ends when no attempt runs and the inbox is empty. Then compact the journal when it grew past Config.compact.
# Done{True} when an attempt ran or an ask was answered. work runs on its own; target names the breaker that guards it.
def tick(~A: Data, ~penc: A -> Bytes.Bytes, ~target: A -> String, ~work: A -> IO(Retry.Outcome), r: Runner) -> IO(Runner & Out(Bool)):
do IO & Out(Bool)>:
now : Nat <- clock()
t : Runner & Out(Bool) <- tick.at(~A, ~penc, ~target, ~work, now, r)
tick.grown(~A, ~penc, t)
Uses (13):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String
https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes
https://jend.leeeet.dev/definition.txt?path=bend-kit-retry@0.3.0.0/retry.bend&name=Outcome
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=Out
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=Runner
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=clock
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=tick.at
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=tick.grown