Consider adding a GetHandleWrapper overload with Func<Task> and ILambdaSerializer
- Lenguaje dominante
- C#
- Estrellas
- 1.7k
- Forks
- 503
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 19
Descripción
## 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
Guía de contribución
Línea de trabajo
Empieza leyendo las sobrecargas existentes de HandlerWrapper.GetHandlerWrapper, especialmente las sobrecargas Func y Func genéricas que aceptan ILambdaSerializer. Confirma cómo gestiona la selección actual de sobrecarga un handler asíncrono y, a continuación, verifica que la sobrecarga propuesta evita que el handler termine antes de que se ejecute su trabajo asíncrono.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- aws, csharp
- Área
- backend, cloud
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100