prepareRemoteRuntimeRequest (shared/remote-runtime-prepared-request-admission.ts)

orca · src/shared/remote-runtime-prepared-request-admission.ts · typescript · MIT
ai, infra

Admission controller that limits pending remote runtime requests and tracks memory usage.

// Source: https://github.com/stablyai/orca | License: MIT | Copyright 2026 Lovecast Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { RemoteRuntimeClientError } from './remote-runtime-client-error'
import {
  REMOTE_RUNTIME_MAX_PENDING_REQUESTS,
  REMOTE_RUNTIME_MAX_PENDING_RPC_BYTES,
  REMOTE_RUNTIME_MAX_PROCESS_PENDING_REQUESTS,
  REMOTE_RUNTIME_MAX_PROCESS_PENDING_RPC_BYTES,
  retainedRemoteRuntimeJsonStringBytes
} from './remote-runtime-memory-limits'
import type { RuntimeRpcResponse } from './runtime-rpc-envelope'

export type RemoteRuntimePreparedRequest = {
  retainedBytes: number
  serializedRequest: string | null
  releaseProcessAdmission: () => void
}

export type RemoteRuntimePendingRequest<TResult> = {
  resolve: (response: RuntimeRpcResponse<TResul

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key