As outlined in a [Swift forums post in November ’21](https://forums.swift.org/t/swiftnio-swift-version-support/53232), SwiftNIO will only support the latest non-patch Swift release and the 2 immediately prior non-patch versions.
In this commit we drop support for Swift 5.2 and 5.3.
motivation: the runtime library has a stabel API while the events are still moving target, so in order to provide a 1.0 stable version we should separate them out
changes:
* import events module from the swift-aws-lambda-runtime, including git history
* update docker setup
* remove redundant examples and scripts
- Add an `AsyncLambdaHandler`. Will be renamed to `LambdaHandler` as soon as we drop the current callback based `LambdaHandler`.
- The default way to use an `AsyncLambdaHandler` is to use `@main` to execute it. Don't use `Lambda.run` for it. We wan't to remove `Lambda.run` for 1.0.
Co-authored-by: tomer doron <tomerd@apple.com>
Modifications:
- Replace `HTTPHandler` with `NIOHTTPClientResponseAggregator`, to fix a CoW issue. This increases performance.
- Ensure that we only use one `EventLoop` in tests.
- Use `syncOperations` to setup the `HTTPClient`.
* allow the users of client to provide headers
* add initialization error header
* add error header to failed invocations
* fix external setting of ip and port via config
* add tests
motivation: allow end to end testing locally
changes:
* add a Lambda+LocalServer which exposes Lambda.withLocalServer available only in DEBUG mode
* local server can receive POST requests with payloads on a configurable endpoint and and send them to the Lambda
* move Lifecycle completely into EventLoop
* remove all locks since running in one EventLoop
* Use UUID for requestId
Co-authored-by: tom doron <tomer@apple.com>
motivation: make testing lambda easy
changes:
* add a AWSLambdaTesting module
* add helper methods for testing different types of Lambda handlers / closures
motivation: support S3 Events
changes:
- Created `AWSLambdaEvents` target
- Added S3 Event as first event
- Use propertyWrapper for customers Encoding/Decoding
motivation: unique, accurate name
changes:
* rename project to SwiftAWSLambdaRuntime
* rename main module to AWSLambdaRuntime
* rename / simplify sample module names
* adjust readme and scripts
motivation: amazon linux support will land in 5.2
changes:
* remove inline as its default in 5.2
* remove linux test and lean on --enable-test-discovery
* adjust package syntax
* format code to match 5.2
motivation: nicer apis, happier users
changes:
* use ByteBuffer + EventLoopFuture for core APIs instead of byte array and callbacks
* create three base protocols: ByteBufferLambdaHandler, EventLoopLambdaHandler and LambdaHandler
* abstract common encoding/decoding functionality into a EventLoopLambdaHandler, reducing most code from string/codable handlers
* only the highest level LambdaHandler is offloaded to a DispatchQueue, lower level is run on the same EventLoop as the core library
* refine encoding/decoding logic
* inline all the things
* adjust tests
* adjust api docs
* adjust readme
motivation: better performance
changes:
* simply url configuration to ip and port so we can reoslve the socket add ress faster
* skip happy eyeballs
* limit eventloop group to 1 thread
* remove use of UUID and URL
* fix backtrace url
motivation: benchmark for comparison of warm/cold runs
changes:
* refactor configuration
* add mock server that can be used by perf tests
* add simple perf test script
* change redundant classes to structs, make remaining classes final
* make offloading opt-in
* safer locking
* fix format
motivation: make code simpler to reason about, better use of swift-nio
changes:
* remove main loop on global queue + wait, replace with recursion
* make better use of EvenLoopFuture, instead of result types to signal errors
* inject lifecycleId so we can share offloading queue
* improve logging
* adjust and improve tests
* update sanity and generate linux tests script to work better with dates and swiftformat
* update code to swift5 and nio2
motivation: support newer version of swift and underlying dependencies
changes:
* adjust code to swift 5
* use swift 5 result type and better error handling for json encoding/decoding
* adjust code to nio 2
* add dependency on swift-log for logging instead of print statements
* make logger as part of context
* improve error handling
* add dependecy on swift-backtrace to capture crashes
* improve lifecycle
* adjust tests
* add default formatting rules and fix formatting
* improve readme
* shutdown handler, lambda api adjustment, latest swift-nio
motivation:
* shutdown: while not required, demonstrate better example for shutdown
* latest nio and api adjustments: fixes runtime issues observed when running for realz
changes:
* add signal based shutdown hook that terminates and cleans up resources
* pull latest swift-nio to get fix to thread renaming
* adjust aws lambda api prefix and headers
* reformat linux tests code