swift-server / swift-aws-lambda-runtime

Swift implementation of AWS Lambda Runtime
Apache License 2.0
1.13k stars 102 forks source link

Drop sync and closure APIs #222

Closed fabianfett closed 3 years ago

fabianfett commented 3 years ago

Fixes #212.

Motivation:

For 1.0 we want to have an API that we are happy with going forward. Everything we are not 100% happy with should go out before 1.0. With the release of Swift 5.5, we don't want to have callback based APIs anymore. For this reason we drop support for callback based APIs with this PR.

This also includes the way we deal with Lambda lifecycle: We drop the API's in which a user could create a Handler themselves and pass it to Lambda. The Handler creation is now always a part of the Lambda's lifecycle. For advanced users (users who wish to implement bridges to server frameworks) the advanced Lambda.Lifecycle API will stay.

Modifications:

Result:

Smaller, cleaner API for 1.0.