Commit Graph
22 Commits
Author SHA1 Message Date
c915322eca API Refactoring (#273)
motivation: define stable API in preperation 1.0 release

changes:
* require swift 5.7, remove redundant backwards compatibility code
* make LambdaHandler, EventLoopLambdaHandler, and ByteBufferLambdaHandler disjointed protocols to reduce API surface area
* create coding wrappers for LambdaHandler and EventLoopLambdaHandler to provide bridge to ByteBufferLambdaHandler
* reuse output ByteBuffer to reduce allocations
* add new SimpleLambdaHandler with no-op initializer for simple lambda use cases
* update callsites and tests
* update examples

Co-authored-by: Yim Lee <yim_lee@apple.com>
Co-authored-by: Fabian Fett <fabianfett@apple.com>
2022-11-09 10:08:36 -08:00
Yim Lee 98a23b64bb DocC setup (#270) 2022-08-21 20:29:08 -07:00
tomer doron d35e827121 Remove extension for JSONEncoder and JSONDecoder (#257)
motivation: we should not publicly extend types we do not own

change: remove extensions which are largely API sugar that is not directly related to Lambda
2022-04-15 13:05:49 +02:00
Fabian Fett 011e8ddc4b Rename Lambda.Context to LambdaContext (#233) 2021-09-30 01:56:58 +02:00
Fabian Fett e5aa488a26 [RFC] Drop event label from handle methods in LambdaHandlers (#225)
* Drop event label from handle method in LambdaHandlers
* Rename `In` to `Event` and `Out` to `Output` in `EventLoopLambdaHandler`
2021-09-22 16:59:07 +02:00
Fabian Fett 454fe2e037 Drop sync and closure APIs (#222)
motivation: with async/await, no need in closure based APIs

changes:
* Drop closure APIs
* Rename AsyncLambdaHandler -> LambdaHandler
* Removed unnecassary public acls from tests
2021-08-24 14:20:13 -07:00
Fabian Fett f01a9b607b Use explicit NIO imports (#220)
- Use explicit NIO modules `NIOCore`, `NIOPosix` and `NIOEmbedded` introduced with SwiftNIO 2.32.0
2021-08-19 09:42:23 +02:00
Fabian Fettandtomer doron 19fc295aa0 async/await support (#186)
- 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>
2021-04-27 22:47:11 +02:00
Fabian Fett 19a9f92538 Inline default LambdaHandler implementations (#201)
Add `@inlinable` to default LambdaHandler implementations. This ensures that those implementations can be inlined into user code and can be specialized for their input and output types.
2021-04-14 22:59:42 +02:00
Fabian Fett a49a87341a Update swiftformat (#196)
changes: 
* Update swiftformat from 0.44 to 0.47
* Adjust rules
2021-03-26 10:34:34 -07:00
Fabian FettandKonrad `ktoso` Malawski 2067f4aea1 JSONEncoder/JSONDecoder and String convenience methods (#144)
Co-authored-by: Konrad `ktoso` Malawski <konrad.malawski@project13.pl>
2020-08-03 21:04:13 +02:00
Fabian Fett 0008e59bab Rename payload to event (#115) 2020-06-07 07:47:05 -07:00
Fabian Fett 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 Fett 9df8a1a468 Rename RequestWork to GetNextInvocation (#74) 2020-05-07 08:37:07 -07:00
tomer doron 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 Fett 2297929bfd LambdaCodableEncoder should be less Foundation biased (#66) 2020-04-27 10:32:17 -07:00
Fabian Fett 378adf844d Allow integration with API Frameworks: Public Lifecycle (#58)
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
2020-04-22 16:10:38 -07:00
Fabian Fett 6f7103251a Reusable JSONCoders (#50)
motivation: beter performance

changes: 
* abstract JSONCoders and have a default static instance
* make encoding/decoding DRYer across String and Codable
2020-03-27 09:21:42 -07:00
Fabian Fett ac290985fa Reuse DispatchQueue for multiple Invocations (#49)
should fix #39
2020-03-26 13:58:28 -07:00
Fabian Fett 87121ec394 Capitalized HttpClient to HTTPClient filename (#47) 2020-03-25 10:52:22 -07:00
Fabian Fett 2cd6bce4d3 Remove use of JSONEncoder for Error Reporting (#42)
motivation: better performance for error response encoding 

changes: use string builder instead of Codable -> String with JSONEncoder
2020-03-18 20:23:53 -07:00
tomer doron b61aab012e rename project to SwiftAWSLambdaRuntime (#38)
motivation: unique, accurate name

changes:
* rename project to SwiftAWSLambdaRuntime
* rename main module to AWSLambdaRuntime
* rename / simplify sample module names
* adjust readme and scripts
2020-03-13 14:48:25 -07:00