Switches a Rducks-enabled DuckDB connection to an inproc_concurrent
execution plan for subsequent scalar-UDF registrations and updates the native
runtime backend. This backend preserves R's thread discipline: DuckDB
worker-side scalar-UDF callbacks submit chunk requests to an extension-owned
queue, and the recorded main R thread drains the queue and performs all R API
work. This is a same-process scheduling mode, not a performance promise; R
function calls are still serialized on the main R thread.
Arguments
- con
A
duckdb_connectionalready enabled withrducks_enable().- threads
Optional positive integer to set with
PRAGMA threadsbefore enabling the in-process backend. UseNULLto leave unchanged.- external_threads
Optional positive integer to set with
SET external_threadsbefore enabling the in-process backend. UseNULLto leave unchanged. For actual DuckDB worker concurrency, keep this smaller thanthreads(for examplethreads = 4, external_threads = 1).
Details
This is a compatibility helper for the arrow_r/arrow_c in-process queue.
New code can call rducks_set_execution_plan()
directly with rducks_execution_plan("arrow_r", "inproc_concurrent") or
rducks_execution_plan("arrow_c", "inproc_concurrent"). Select the plan
before registering scalar UDFs whose reported execution plan should be the
queued in-process path.
Examples
# \donttest{
db <- duckdb::dbConnect(duckdb::duckdb(config = list(allow_unsigned_extensions = "true")))
rducks_enable(db)
rducks_enable_inproc(db)
rducks_release(db)
DBI::dbDisconnect(db)
# }