Expand description
Function runner — executes TypeScript functions via the bidirectional protocol.
The runner manages the connection to the Bun/Deno process and mediates all communication. It handles DB operations, stream forwarding, scheduling, and transaction management.
Structs§
- FnCall
Error - FnRunner
- Manages the TypeScript process and executes function calls.
Constants§
- DEFAULT_
CALL_ TIMEOUT - Default ceiling on how long a single function call may take. Holds the
SQLite write lock for mutations, so this is also a backstop against a
runaway TS handler blocking the whole DB. Override via
FnRunner::set_call_timeoutorPYLON_FN_CALL_TIMEOUT(server-side).
Type Aliases§
- Nested
Call Hook - Callback invoked when a running function asks to run another function
(action → query/mutation). The wrapper is responsible for any per-type
setup — notably wrapping mutations in their own BEGIN/COMMIT, which
can’t happen inside
call_innerbecause that path holds the io_lock and is called with the outer action’s non-transactional store. - Schedule
Hook - Callback invoked when a function calls
ctx.scheduler.runAfter/runAt. ReturnsOk(job_id)on success orErr(msg)on persistence/queue failure. The runner reports the error back to the calling handler so users don’t get a silent{scheduled: true, id: ""}. - Stream
Callback - Callback invoked for each stream chunk during function execution. The server layer converts these into SSE events on the HTTP response.