Documentation Index
Fetch the complete documentation index at: https://mintlify.com/backpine/durable-effect/llms.txt
Use this file to discover all available pages before exploring further.
JobsClient is the typed interface for interacting with job instances from your Cloudflare Worker’s fetch handler. All methods return Effects and can be yielded inside Effect.gen.
Creating the client
JobsClient.fromBinding takes the Durable Object namespace binding and returns a fully typed client scoped to your registered jobs.
Instance IDs
Every job instance is identified by a user-provided ID. Internally, the Durable Object instance ID follows this pattern:"user-123") when calling client methods. The prefix is added automatically.
Continuous client
Access viaclient.continuous(jobName).
start(options)
Start a continuous job instance. If the instance already exists, returns the existing status without restarting.
trigger(id)
Trigger an immediate execution, bypassing the schedule.
status(id)
Get the current status of a continuous job instance.
getState(id)
Get the current persisted state of a job instance.
terminate(id, options?)
Terminate the job instance: cancel the alarm and delete all state. The instance ID can be reused to start a fresh instance.
Debounce client
Access viaclient.debounce(jobName).
add(options)
Add an event to the debounce buffer. Creates the instance if it does not exist yet.
flush(id)
Force an immediate flush of accumulated events, bypassing flushAfter.
clear(id)
Clear the accumulated event buffer without processing it.
status(id)
Get the current status of a debounce instance.
getState(id)
Get the current accumulated state.
Task client
Access viaclient.task(jobName).
send(options)
Send an event to a task instance. Creates the instance if it does not exist yet.
trigger(id)
Trigger immediate execution, bypassing any scheduled alarm.
status(id)
Get the current status of a task instance.
getState(id)
Get the current state and schedule information.
terminate(id)
Terminate the task instance: cancel the alarm and delete all state.
Using the client in Effect.gen
All client methods return Effects. Use them insideEffect.gen with yield*:
