109 Commits
Author SHA1 Message Date
tomer doronandGitHub 2bac89639f add syncShutdown to LambdaHandler (#132)
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
0.2.0
2020-06-18 12:48:13 -07:00
Andrea ScuderiandGitHub 0535cb72eb Fix SAM Examples after directory change (#124) 2020-06-17 13:37:51 -07:00
tomer doronandGitHub 034afa1a9b update contributors list (#131)
motivation: give credit where credit due

changes: update CONTRIBUTORS.txt with recent contributions
2020-06-17 11:33:31 -07:00
Adam FowlerandGitHub d2f5c1c324 Added SES Event type (#130)
motivation: support event triggers from SES

changes: Added SES Event type
2020-06-17 09:53:53 -07:00
Fabian FettandGitHub 437a60d7a0 Added shutdown() -> EventLoopFuture<Void> to the ByteBufferLambdaHandler (#122)
* Added `syncShutdown() throws` to the `ByteBufferLambdaHandler`

* Updated to use a `ShutdownContext`

* Review comments addressed.
2020-06-17 07:34:01 -07:00
Ro-MandGitHub 77280662e3 Added header when reporting failing invocations or initializations #116 (#128)
* 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
2020-06-17 06:55:05 -07:00
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
tomer doronandGitHub 246088e340 Add GitHub issue and PR templates (#127)
motivation: capture issue/PR info consistently

changes: add .github directory with relevant PR and issue templates
2020-06-15 10:16:01 +02:00
Andrea ScuderiandGitHub c683b41545 Add example scripts and docs for Serverless Framework (#113)
* Add example scripts and docs for Serverless Framework
* Refactor Examples folder and scripts
- Add a common config.sh script
- Move SAM templates to scripts/SAM
- Add Serverless templates to scripts/serverless
- Update the scripts to work with new folder structure and config.sh
2020-06-12 12:14:37 -07:00
Fabian FettandGitHub a5e2fd0f10 Readme: Making Request and Response types explicit in Lambda.run callback (#111) 2020-06-07 08:06:15 -07:00
Fabian FettandGitHub 0008e59bab Rename payload to event (#115) 2020-06-07 07:47:05 -07:00
Eneko AlonsoandGitHub 71587eab10 Document configuration variables in deploy.sh (#97) 2020-06-06 18:21:35 -07:00
tomer doronandGitHub aa6468b360 add docker-compose setup for amazon linux (#114)
motivation: swift 5.2.4 now supportes AL2

changes:
* add docker-compose file for al2 5.2.4
* correct 5.3 docker-file to say al2 instead of 18.04
2020-06-05 20:23:08 -07:00
Brendan KirchnerandGitHub 5e546a1a9e Added jq requirement to examples readme (#106)
* Added jq requirement to readme
2020-06-03 10:44:28 -07:00
Christoph WalcherandGitHub c562cb8d0f Fix Typo in readme.md (#110) 2020-06-03 17:26:55 +02:00
tomer doronandGitHub 3b29513652 handle lambda errors correctly in mock server (#104)
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
2020-06-01 13:15:30 -07:00
tomer doronandGitHub e2ac820289 add an option to start the local debugging server based on an env variable (#87)
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
2020-06-01 12:38:06 -07:00
Johannes WeissandGitHub cc345ba7ce link Fabian's great getting started guide (#103) 2020-06-01 06:41:32 -07:00
Colton SchlosserandGitHub 7d646b49b2 Readme typo (#101) 2020-05-31 09:28:49 -07:00
Bryan MoffattandGitHub eaa6fb6338 Add a User-Agent when using the Lambda Runtime API (#98)
* Add a User-Agent when using the Lambda Runtime API
2020-05-30 10:39:34 -07:00
pmarrufoandGitHub f1ce84f70b Fix typo in ErrorHandling Example (#93)
* Fix typo
2020-05-29 13:42:44 -07:00
Zhibin CaiandGitHub f35f87c9e5 fix typo in readme.md (#95)
* fix typo in readme.md
2020-05-29 13:40:19 -07:00
Max DesiatovandGitHub cac8e72c85 Fix typo in readme.md (#94) 2020-05-29 13:32:29 -07:00
Bryan BartowandGitHub 03e5d7ed95 Fix typo (#92) 2020-05-29 12:24:26 -07:00
75d05ca954 docs cleanup (#91)
motivation: cleanup docs for oss

changes:
* add useful information in readme, with pointers to examples
* update ci setup and example to use latest tools
* update contributors list

Co-authored-by: Yim Lee <yim_lee@apple.com>
0.1.0
2020-05-28 12:19:19 -07:00
tomer doronandGitHub 3cb9330832 fix example correctness (#90)
motivation: make example more correct

changes: update response in DispatchQueue.main
2020-05-28 09:59:56 -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
Fabian FettandGitHub fe60959b99 fix race condition when shutting down server
motivation: fix a race condition that can lead to crash and failing tests

changes: close channel when canceling
2020-05-21 09:11:29 -07:00
d956b89dbc improve debugging example (#84)
motivation: clearer examples as we prepare to open source

changes:
* rename debugging example to make the name more accurate
* add more information in the local debugging example
* add a Shared module to show how to share code between client and server
* make example more useful - use JSON for registration like flow
* add docker-compose task to test examples

Co-authored-by: Yim Lee <yim_lee@apple.com>
2020-05-21 09:07:38 -07:00
tomer doronandGitHub e907bd5edf fix small typo (#80) 2020-05-20 10:04:00 -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
tomer doronandGitHub 64ee5a215c small fixes to the perf script (#78)
motivation: keep script up to date

changes:
* use 5.3 nightly
* better support for perf symlink as the location is a moving target
* info about cold/warm start
2020-05-12 16:04:30 -07:00
ab3ce640aa Use NIO in Single Threaded Mode (#68)
motivation: better performance 

changes:  employ SwiftNIO's new Single Threaded Mode

Co-authored-by: tomer doron <tomerd@apple.com>
2020-05-12 13:41:10 -07:00
Fabian FettandGitHub d3b75176dd Update APIGateway example to use AWSLambdaEvents (#76)
motivation: example of how to use the API Gateway model

changes: Update APIGateway example to use AWSLambdaEvents
2020-05-12 12:41:01 -07:00
76b2332477 update readme (#75)
motivation: better and more up-to-date information 

changes: rewrite readme to reflect APIs and architecture

Co-authored-by: Konrad `ktoso` Malawski <konrad.malawski@project13.pl>
Co-authored-by: Fabian Fett <fabianfett@mac.com>
2020-05-11 10:39:19 -07:00
Fabian FettandGitHub b7462b8081 Make Lambda.env() -> String? public (#61) 2020-05-08 12:35:55 -07:00
tomer doronandGitHub 9310ad8f65 Merge pull request #72 from swift-server/move-samples
move samples into a subdirectory
2020-05-07 09:47:16 -07:00
tomer doronandGitHub e97f05e7cb Merge branch 'master' into move-samples 2020-05-07 09:47:01 -07:00
Fabian Fettandtom doron 5361e2f649 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:45:13 -07:00
Fabian Fettandtom doron b7962a8213 Added DynamoDB Event (#65)
motivation: support DynamoDB triggers

changes: added DynamoDB Event abstractions and encoders/decoders
2020-05-07 09:45:13 -07:00
Fabian Fettandtom doron bf1b08cb8e Rename RequestWork to GetNextInvocation (#74) 2020-05-07 09:45:13 -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
Fabian FettandGitHub 29d631709f Added DynamoDB Event (#65)
motivation: support DynamoDB triggers

changes: added DynamoDB Event abstractions and encoders/decoders
2020-05-07 09:05:11 -07:00
tom doron b5f18dad4b move examples into a subdirectory
motivation: easier to find and reason about

changes: move exmaples from a seperate repo into a subdirectory
2020-05-07 08:56:31 -07:00
Fabian FettandGitHub 9df8a1a468 Rename RequestWork to GetNextInvocation (#74) 2020-05-07 08:37:07 -07:00
tom doron d5368bbe25 moving examples into a subdirectory 2020-05-06 12:19:03 -07:00
tomer doronandGitHub 593f0395d6 better links to events docs (#67)
motivation: link to developer guide instead of golang impl

changes: add/change event doc links to https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html
2020-05-06 07:23:54 -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
Fabian FettandGitHub 8509674ed0 Add apigateway and alb (#52)
motivation: support ALB and APIGateway Events

changes: add Codable abstractions for ALB and APIGateway v1+v2  Events
2020-04-27 10:49:44 -07:00
Fabian FettandGitHub 2297929bfd LambdaCodableEncoder should be less Foundation biased (#66) 2020-04-27 10:32:17 -07:00