Runner.enqueue: def of bend-kit-runner@0.13.0.1
Import: import bend-kit-runner@0.13.0.1/runner.bend as Runner
Lines 1117-1122 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=1117&end_line=1122
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-scheduler@0.4.1.0/queue.bend as Q
# Adds a job that is due at deadline (wall-clock ms) and answers its ticket id once the record is durable.
def enqueue(~A: Data, ~penc: A -> Bytes.Bytes, r: Runner, +deadline: Nat, x: A) -> IO(Runner & Out(Nat)):
Runner{j, +s, p, c, ib, fs} = r
do IO & Out(Nat)>:
y : Ran(A) <- commit(~A, ~penc, Runner{j, s, p, c, ib, fs}, Enqueue{deadline, x})
return enqueue.done(A, Q.next_id(A, queue(A, s)), y)
Uses (14):
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=IO.pure
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=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=Op
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=Ran
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=commit
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=enqueue.done
https://jend.leeeet.dev/definition.txt?path=bend-kit-runner@0.13.0.1/runner.bend&name=queue
https://jend.leeeet.dev/definition.txt?path=bend-kit-scheduler@0.4.1.0/queue.bend&name=next_id