dr_rate_limit(app, capacity, window, type, scope, routes) —
per-route or shared rate limit (sliding / fixed window or token
bucket); over-budget requests get HTTP 429 + Retry-After from the
I/O thread before R is involved.rate-limiting.Rmd.dr_stream(next_chunk, state, ...) returns
HTTP chunked responses driven by an R generator pumped on the main
R thread, with a cancelled = TRUE cleanup contract on client
disconnect.dr_stream_sse(generator, ...) convenience wrapper that formats
Server-Sent Events frames (multi-line data is split per the SSE
spec) and adds the Cache-Control: no-cache /
X-Accel-Buffering: no headers expected by typical SSE clients.streaming.Rmd with the threading caveats and end-to-
end examples.dr_get("/users/:id", ...). Three
placeholder syntaxes are accepted interchangeably — :name,
<name>, {name} — and exposed to handlers as a named character
vector in req$params.dr_text(), dr_html(), dr_redirect(),
dr_file(). dr_file() auto-detects the MIME type from a built-in
table covering ~25 common extensions, supports download_as = ...
for Content-Disposition: attachment, and warns/errors on
oversized loads (>50MB / >500MB).pipe(2) /
fcntl(2) wakeup mechanism with a loopback TCP socketpair
on Windows. (Full Windows binary build is still pending.)dr_json(): new C++ walker for basic types replaces jsonlite. Hits
118k req/s (12x boost) with silent fallback.mcparallel (fork) to processx
(spawn). Fixes later fds and sink stack issues in tests; ensures
a clean R state for each worker.dr_serve(workers = N) spawns N forked R
workers sharing the listening port via SO_REUSEPORT.on_worker_start callback in dr_serve() for per-worker
initialization (load models, open per-worker resources).dr_status() reports the live worker pids of a multi-process serve.dr_serve(max_queue = N) bounds the request queue and rejects
excess requests with HTTP 503, providing backpressure under
overload.Initial development release.
pkg-config or a manual search), the
package is built with TLS enabled. Otherwise it falls back to a
plain-HTTP build with a single message at install time.--with-openssl / --without-openssl flags can force the choice
(passed via R CMD INSTALL --configure-args=...).<random> instead of libuuid,
removing the system dependency on Linux.