feat: lambda custom runtime
part of https://github.com/typelevel/feral/issues/134
This commit resumes https://github.com/typelevel/feral/pull/276/ with some modifications.
The main differences between this commit and the PR above are the followings;
in terms of module structure,
- The original
feral-lambdamodule is split intoferal-lambda-kernelandferal-lambda-runtime-bindingferal-lambda-kernelcontains types shared across runtimeferal-lambda-runtime-bindingcontains facades for AWS Java and JS runtimes
- AWS Runtime API stuffs are moved under runtime.api package
- correcting
Lambda-Runtime-Client-IdentitytoLambda-Runtime-Cognito-Identity - adding
LambdaRuntimeAPIClientthat wraps http4sClient
- correcting
- Scala Native support is not included in the commit
in terms of behaviors,
- ~the runtime runs next invocation calls and handlers in parallel~ edit: runtime should not run handlers in parallel.
- the runtime will terminate when Lambda Runtime API returns 500, which implies unrecoverable container error
See also
- https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html
Co-Authored-By: Scott Thomson
the runtime runs next invocation calls and handlers in parallel
Are you sure that AWS Lambda actually support this? i.e. will the GET request for the next event return something different before you POST the result? If so, that would be violating HTTP method semantics.
https://github.com/typelevel/feral/pull/496#discussion_r1669120978
I think we should avoid running handlers in parallel... Sorry for confusionš¢