Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

678 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */

import type { FunctionCallResultMessage } from "../kernel/messages";
import { DeferredRequestRegistry } from "../network/DeferredRequestRegistry";
import { getRequestClient } from "../network/requests";
import type { InvokeFunctionRequest } from "../network/types";

export const FUNCTIONS_REGISTRY = new DeferredRequestRegistry<
  Omit<InvokeFunctionRequest, "functionCallId">,
  FunctionCallResultMessage
>("function-call-result", async (requestId, req) => {
  const client = getRequestClient();
  // RPC counts as a kernel invocation
  await client.sendFunctionRequest({
    functionCallId: requestId,
    ...req,
  });
});