Skip to contents

Saves a sleep checkpoint and releases the claim in one statement. Code after the sleep does not run in this attempt: after the deadline a worker reruns the handler from the top, replaying completed steps, and the sleep returns at once. Suspension travels as canard_suspended, a control-flow condition, so an ordinary error handler does not swallow it.

Usage

ca_sleep(task, name, seconds)

Arguments

task

A claim returned by ca_claim() or passed to an R handler.

name

Stable checkpoint name.

seconds

Nonnegative sleep duration in seconds.

Value

NULL, invisibly, on replay. The first call signals canard_suspended after persisting the suspension.