8 Commits
Author SHA1 Message Date
tomer doronandGitHub d1a927650a add initialization context (#126)
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
2020-06-16 11:08:00 -07:00
Fabian FettandGitHub 0008e59bab Rename payload to event (#115) 2020-06-07 07:47:05 -07:00
tomer doronandGitHub 8c24cffd97 fix context members to follow swift APi guidelines (#88)
motivation: nicer API

changes:
* requestID -> requestID
* traceId -> traceID
* invokedFunctionArn -> invokedFunctionARN
* adjust examples
2020-05-27 11:46:31 -07:00
53930fef38 add debug functionality to test with mock server (#73)
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>
2020-05-15 16:56:17 -07:00
Fabian FettandGitHub 1d9637279a Moved Foundation to AWSLambdaRuntime; AWSLambdaRuntime renamed to AWSLambdaRuntimeCore (#41)
motivation: enable non-foundation module for performance sensitive use cases

changes: 
* rename AWSLambdaRuntime to AWSLambdaRuntimeCore 
* create AWSLambdaRuntime for Foundation dependent functionality 
* have (new) AWSLambdaRuntime export AWSLambdaRuntimeCore
* adjust tests
2020-05-07 09:37:28 -07:00
tomer doronandGitHub 2324074c33 improve type aliases and API docs (#64)
motivation: better documentation, happier users

changes: 
* add more information on public APIs
* move and simplify type aliases
2020-04-28 14:31:43 -07:00
tomer doronandGitHub bfad18623d hide testing harness in release builds (#63)
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
2020-04-27 10:23:56 -07:00
Fabian FettandGitHub 920302a4c3 Improve testing utils (#60)
motivation: make testing lambda easy

changes:
* add a AWSLambdaTesting module
* add helper methods for testing different types of Lambda handlers / closures
2020-04-23 00:11:05 -07:00