aws / aws/aws-lambda-dotnet

Consider adding a GetHandleWrapper overload with Func<Task> and ILambdaSerializer

Ouverte
#999 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
feature-request module/lambda-client-lib p2 queued xs
Langage dominant
C#
Étoiles
1.7k
Forks
503
Merge moyen
1 j 18 h
PR mergées (30 j)
21

Description

## Describe the Feature

There are a number of `HandlerWrapper.GetHandlerWrapper` overloads, but two specific ones do not work well well together and might result in surprising behavior: `GetHandlerWrapper(Func)` and `GetHandlerWrapper(Func, ILambdaSerializer)`.
It's very easy to accidentally use the latter expecting proper async handling, because most overloads have an `ILambdaSerializer` parameter.

### Is your Feature Request related to a problem?
During the preview phase I started manually bootstrapping the Lambda SDK so I could test the preview builds. I started with my Kinesis handlers by using the `GetHandlerWrapper` overloads for that, which require the `ILambda Serializer` and continued to copy+paste that code for other signatures as well. One of those was for a `Func` handler and I just kept going copying the lambda serializer parameter as well.

That lambda then would run until the first, actual async sequence point is reached and then just successfully end, not actually running the required code. This was very hard to debug.

## Proposed Solution
Introducing a `GetHandlerWrapper(Func, ILambdaSerializer)` overload makes sure, this doesn't happen, even though the `ILambdaSerializer` isn't required in that context.

### Environment

* [ ] :wave: I may be able to implement this feature request
* [x] :warning: This feature might incur a breaking change

Introducing a new overload might break existing code, but it's likely that it fixes a bug by doing so.

---

This is a :rocket: Feature Request

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par lire les surcharges existantes de HandlerWrapper.GetHandlerWrapper, en particulier les surcharges Func et Func génériques qui acceptent ILambdaSerializer. Confirmez comment la sélection actuelle de surcharge gère un handler asynchrone, puis vérifiez que la surcharge proposée empêche le handler de se terminer avant l’exécution de son travail asynchrone.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, csharp
Domaine
backend, cloud
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.