No matching definitions.

tur/workflow

stdlib/workflow.tur

persistent workflow helpers built on tur/serial.

Since: Phase 21

defn

save-cont!

(save-cont! [k ptr<void>] :)

serialise an opaque serial-continuation handle to a bytes value.

kopaque continuation pointer from serial-shift

A bytes :ptr<void> on success (a length-prefixed {int64 len; data} buffer the caller owns and must free), or nil if k is nil.

Since: Phase 21

defn

resume-cont!

(resume-cont! [b ptr<void> v : int] :)

deserialise a bytes value and resume the encoded continuation with v.

bserialised bytes from save-cont!
vvalue to pass to the resumed continuation

The continuation's return value, after rebuilding the chain from b and resuming it with v.

Since: Phase 21

defn

workflow-suspend

(workflow-suspend [k ptr<void>] :)

suspend the current workflow step by serialising continuation k.

kopaque continuation pointer from serial-shift

Serialised bytes :ptr<void> from save-cont! (nil if not yet implemented).

(serial-reset
    (let [ok? (serial-shift (fn [k] (workflow-suspend k)) false)]
      ...))

Since: Phase 21

defn

workflow-resume

(workflow-resume [b ptr<void> v : int] :)

resume a previously suspended workflow step with value v.

bbytes value produced by workflow-suspend
vvalue to inject into the resumed continuation

The continuation's return value (0 when not yet implemented).

Since: Phase 21