motivation: in error cases where lamnda fails to start the process fails silently and exists with code 0
changes: change the blocking API to check on the result and fatalError if lambda cannot be started / run
motivation: more correct Xray TraceID
changes:
* add AmazonHeaders::generateXRayTraceID
* Generate correct trace ID in LocalLambda Server
* Generate correct trace ID in LambdaRuntimeClientTest
motivation: Sometimes common header date comes with an alphabetical timezone in brackets after the numeric timezone
changes:
* Support common header date format with brackets
* Update readme with SES Event link
motivation: make shutdown easier to use
changes:
* override shutdown to use the offloadQueue to perform syncShutdown
* add empty syncShutdown that can be implmented by the concrete Lambda function
* 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: in more complex initialization scearios you may want access to a logger or other utilities
changes:
* introduce new InitializationContext type that could be extended in the future without breaking the API in semantic-major way
* instead of passing in EventLoop to the handler factory, pass in a context that includes a Logger, an EventLoop and a ByteBufferAllocator
* fix a bug where we dont hop back to the event loop when coming back from the handler
* adjust tests to the new signature
motivation: better mock server
changes:
* add handler for :requestID/error
* return .accepted to lambda
* return .internalServerError to client + error json
* small refactoring of response code in mock server to make it DRYer
motivation: make using the local debugging server easier to turn off/on without the need to change code when oyu are preparing to deploy
changes:
* add code to lambda so that in debug mode only, if the LOCAL_LAMBDA_SERVER_ENABLED env variable is set the local debugging server is started
* make withLocalServer internal
* update example code
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: testing harness should only be used for testing, and uses @testable import which doe not work in release builds
changes: hide code behind #if check
motivation: make testing lambda easy
changes:
* add a AWSLambdaTesting module
* add helper methods for testing different types of Lambda handlers / closures
motivation: easy integration of web frameworks frameworks like vapor and smoke
changes: expose `Lifecycle` as a public API to allow easy integration with higher level frameworks
motivation: beter performance
changes:
* abstract JSONCoders and have a default static instance
* make encoding/decoding DRYer across String and Codable
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: make initialization logic more robust, allowing setup at contructor time and also async bootstrap
changes:
* remove the initialize method and replace it with a factory pattern.
* update core API and logic to support new initialization flow.
* add tests to various initialization flows