module documentation

Undocumented

Type Alias ConfigureCallback Undocumented
Variable logger Undocumented
Class _WorkerDeps External dependencies injected for testability.
Function _default_extract_lambda_ctx Extract (request_id, function_arn) from a Lambda context object.
Function _default_load_config Undocumented
Async Function _invocation_config_scope Run configure (see run_worker for the forms) against a fresh per-invocation config and yield it. For the generator / context-manager forms, post-yield teardown runs when the caller's block exits, including on error...
Async Function _invocation_handler Handle a single Lambda invocation.
Function _run_worker_internal Core logic with injected dependencies for testability.
Function _validate_task_queue Raise if no task queue has been configured.
ConfigureCallback: TypeAlias = (source)

Undocumented

Value
Callable[[LambdaWorkerConfig],
         None | Awaitable[None] | AsyncGenerator[None, None] | AbstractAsyncContextManager↵
[None]]

Undocumented

def _default_extract_lambda_ctx(lambda_context: Any) -> tuple[str, str] | None: (source)

Extract (request_id, function_arn) from a Lambda context object.

def _default_load_config(getenv: Callable[[str], str | None]) -> ClientConfigProfile: (source)

Undocumented

async def _invocation_config_scope(configure: ConfigureCallback, new_config: Callable[[], LambdaWorkerConfig]) -> AsyncGenerator[LambdaWorkerConfig, None]: (source)

Run configure (see run_worker for the forms) against a fresh per-invocation config and yield it. For the generator / context-manager forms, post-yield teardown runs when the caller's block exits, including on error. Task queue is validated after setup. The config's shutdown hooks run even if validation fails, before that teardown.

async def _invocation_handler(*, lambda_context: Any, configure: ConfigureCallback, new_config: Callable[[], LambdaWorkerConfig], deps: _WorkerDeps, extract_lambda_ctx: Callable[[Any], tuple[str, str] | None]): (source)

Handle a single Lambda invocation.

def _run_worker_internal(version: WorkerDeploymentVersion, configure: ConfigureCallback, deps: _WorkerDeps) -> Callable[[Any, Any], None]: (source)

Core logic with injected dependencies for testability.

def _validate_task_queue(config: LambdaWorkerConfig): (source)

Raise if no task queue has been configured.