-
Notifications
You must be signed in to change notification settings - Fork 113
Allow custom initialisation of the HandlerType of the LambdaRuntime. #308
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tomerd
added a commit
to tomerd/swift-aws-lambda-runtime
that referenced
this pull request
Oct 10, 2023
Motivation: Provide the flexibility for custom initialisation of the HandlerType as this will often be required by higher level frameworks. Modifications: * Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type * Update downstream code to use HandlerProvider * Update upstream code to support passing Hanlder Type of Handler Provider * Add and update tests Originally suggested and coded by @tachyonics in swift-server#308
thanks for putting together @tachyonics, I finally had time to review and came up with a slightly more minimal change in #310. If the minimalistic approach is good enough for your use case we can update #308 to that end and close #310 or vice versa. |
tomerd
added a commit
to tomerd/swift-aws-lambda-runtime
that referenced
this pull request
Oct 10, 2023
Motivation: Provide the flexibility for custom initialisation of the HandlerType as this will often be required by higher level frameworks. Modifications: * Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type * Update downstream code to use HandlerProvider * Update upstream code to support passing Hanlder Type of Handler Provider * Add and update tests Originally suggested and coded by @tachyonics in swift-server#308
tomerd
added a commit
to tomerd/swift-aws-lambda-runtime
that referenced
this pull request
Oct 10, 2023
Motivation: Provide the flexibility for custom initialisation of the HandlerType as this will often be required by higher level frameworks. Modifications: * Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type * Update downstream code to use HandlerProvider * Update upstream code to support passing Hanlder Type of Handler Provider * Add and update tests Originally suggested and coded by @tachyonics in swift-server#308
tomerd
added a commit
to tomerd/swift-aws-lambda-runtime
that referenced
this pull request
Dec 7, 2023
Motivation: Provide the flexibility for custom initialisation of the HandlerType as this will often be required by higher level frameworks. Modifications: * Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type * Update downstream code to use HandlerProvider * Update upstream code to support passing Hanlder Type of Handler Provider * Add and update tests Originally suggested and coded by @tachyonics in swift-server#308
tomerd
added a commit
to tomerd/swift-aws-lambda-runtime
that referenced
this pull request
Dec 8, 2023
Motivation: Provide the flexibility for custom initialisation of the HandlerType as this will often be required by higher level frameworks. Modifications: * Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type * Update downstream code to use HandlerProvider * Update upstream code to support passing Hanlder Type of Handler Provider * Add and update tests Originally suggested and coded by @tachyonics in swift-server#308
Closing as this has been replaced by #310 |
tomerd
added a commit
that referenced
this pull request
Jan 18, 2024
…310) Motivation: Provide the flexibility for custom initialization of the HandlerType as this will often be required by higher level frameworks. Modifications: * Modify the LambdaRuntime type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type * Update downstream code to use HandlerProvider * Update upstream code to support passing Handler Type of Handler Provider * Add and update tests Originally suggested and coded by @tachyonics in #308
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow custom initialisation of the HandlerType of the LambdaRuntime.
Motivation:
Provide the flexibility for custom initialisation of the HandlerType as this will often be required by higher level frameworks.
Modifications:
Modify the
LambdaRuntime
type to accept a closure to provide the handler rather than requiring that it is provided by a static method on the Handler type. This is achieved by a new base protocolNonFactoryByteBufferLambdaHandler
that does not have themakeHandler
function requirement.Also provide a new base protocol
NonFactoryLambdaHandler
that doesn't have the initialisation requirements of eitherLambdaHandler
orSimpleLambdaHandler
. This will allow higher level frameworks to initialise their own handlers that however can take advantage of theCodable
conveniences of this package.Result:
Existing high level use cases (
LambdaHandler
andSimpleLambdaHandler
) will continue to be provided but a lower level integration will be possible aimed at higher level frameworks.