Skip to content
Unverified Commit 3fb90968 authored by Burak's avatar Burak Committed by GitHub
Browse files

Python: Allow injecting Lambda Context (#1985)



* Provide Python wrappers for Lambda related types

* Introduce `PyContext` to wrap raw context object

* Use new `PyContext` in handlers

* Expose `lambda` module to Python

* Use `LambdaContext` in example service

* Start Lambda handler in a different thread

* Print summary of Lambda context in Pokemon service

* Make sure to include Python `builtins` in tests

* Make `lambda_ctx` optional

Co-authored-by: default avatarMatteo Bigoi <1781140+crisidev@users.noreply.github.com>

* Only inject types if they are type-hinted as `Optional[T]`

* Export Lambda module as `aws_lambda` instead of `lambda_`

* Comment why we need to run Hyper server in a background thread

* Move `is_optional_of` to `util` module

* Use `HeaderMap::from_iter` to build headers

* Support edge case of `(None, T)` in `util::is_optional_of`

* Make Lambda related types feature gated

* Remove feature gate for Lambda

* Make `xray_trace_id` an `Option`

* Remove `aws-lambda` feature from generated `Cargo.toml`s

* Fix linting issues

* Pin `lambda_runtime` to `0.7.1`

* Remove duplicate dependency in `Cargo.toml`

Co-authored-by: default avatarMatteo Bigoi <1781140+crisidev@users.noreply.github.com>
parent 9d2d0880
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment