-
Notifications
You must be signed in to change notification settings - Fork 118
Add new handler protocols + Codable support #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s. Add closure handlers for StreamingLambdaHandler + NewLambdaHandler. Add Codable adapters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress! We need docs, docs and docs. Take them from the proposal!
…mWriter`, move Foundation import from AWSLambdaRuntimeCore
|
API breakage check also reports on package access modifiers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
Motivation:
As part of the implementation of the v2 API (#339), we want to add the handler protocols
LambdaHandlerandLambdaWithBackgroundProcessingHandler.Modifications:
Added the two remaining handler protocols:
LambdaHandlerandLambdaWithBackgroundProcessingHandler.LambdaHandleris currently temporarily named asNewLambdaHandleras there is already an existingLambdaHandler. This will be sorted out closer to release.Added
LambdaHandlerAdapterandLambdaCodableAdapterto allow the two new handler protocols to work with theLambdaRuntime(asLambdaRuntimerequires aStreamingLambdaHandlerconforming handler).LambdaHandlerAdapter:LambdaHandlerconforming handler to conform toLambdaWithBackgroundProcessingHandlerby passing the output returned fromLambdaHandlertoLambdaWithBackgroundProcessingHandler's output writer.LambdaCodableAdapter:LambdaWithBackgroundProcessingHandlerconforming handler to conform toStreamingLambdaHandler.ByteBufferevent intoLambdaWithBackgroundProcessingHandlers genericEventobject, and passes this to itshandle(...)function.LambdaResponseWriterinto aByteBufferand send this toStreamingLambdaHandler'sLambdaResponseStreamWriter.Added
StreamingClosureHandlerandClosureHandlerstructs conforming toStreamingLambdaHandlerandLambdaHandlerprotocols respectively.handle(...)function.Result:
LambdaHandlerandLambdaWithBackgroundProcessingHandlercan be used with the newLambdaRuntimethrough the adapters.