Documentation
¶
Overview ¶
Package lambdaruntime runs Lambda functions as supervised local processes that speak the AWS Lambda Runtime API. Each function gets one child process (serial invocations in this phase) started with AWS_LAMBDA_RUNTIME_API pointing at a per-function loopback listener serving the four runtime routes:
GET /2018-06-01/runtime/invocation/next
POST /2018-06-01/runtime/invocation/{id}/response
POST /2018-06-01/runtime/invocation/{id}/error
POST /2018-06-01/runtime/init/error
The official runtime interface clients (provided.al2 bootstrap, awslambdaric for Python/Node) speak this protocol unmodified — so real handlers run with no Docker.
Index ¶
Constants ¶
const DefaultPoolMax = 5
DefaultPoolMax is the concurrency ceiling for a function with no reserved concurrency configured — how many child processes can run its invocations at once. Kept modest so a local stack doesn't fork a process per request.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool runs a function's invocations across a growable set of Runners (one child process each), giving up to Max concurrent executions. It grows lazily to match observed concurrency and never exceeds Max — the local analogue of Lambda's per-function concurrency. Under serial load it stays at one Runner.
func (*Pool) Invoke ¶
Invoke runs one invocation on a pooled Runner, spawning another (up to Max) when concurrent demand exceeds the current pool size.
type Result ¶
type Result struct {
Payload []byte
FunctionErr string // non-empty on a handler error (X-Amz-Function-Error)
Logs []byte // tail of stdout/stderr
}
Result is one invocation's outcome.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner supervises one function's process and Runtime API listener.
type Spec ¶
type Spec struct {
Name string
Handler string
Runtime string // provided.*, go, python3.x, nodejs*
Command []string // explicit command (doze extension) — wins over Runtime mapping
Dir string // working directory
Env map[string]string // function environment
Timeout time.Duration
Endpoints map[string]string // AWS_ENDPOINT_URL_* injected so handlers reach sibling services
}
Spec describes how to run one function.