Skip to contents

Loads the optional canard_coordinator extension in the database-owner process and starts it marking abandoned tasks failed across every queue, on its own DuckDB connection and native thread. Workers keep doing the same for the queues they poll; this covers queues nobody polls.

Usage

ca_coordinator_start(
  db,
  extension = NULL,
  poll_milliseconds = 1000,
  reap_limit = 64
)

Arguments

db

A local handle returned by ca_open() or ca_serve().

extension

Optional path to a compatible coordinator extension. NULL loads an explicitly preinstalled canard_coordinator extension.

poll_milliseconds

Delay between maintenance polls, in milliseconds.

reap_limit

Maximum expired tasks failed by one poll.

Value

TRUE if this call started the coordinator and FALSE if it was already running.

Details

It can start once per database instance. Call ca_coordinator_stop() or ca_close() to join the thread and release the connection: the extension holds that connection from the moment it loads, so closing the DBI connection directly leaves the database open, locked and maintained until the process exits.

No signed build is distributed, so a local build loads only into a database opened with allow_unsigned_extensions = TRUE; see ca_open().