aws / aws/aws-lambda-dotnet

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

オープン
#999 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature-request module/lambda-client-lib p2 queued xs
主要言語
C#
スター
1.7k
フォーク
503
平均マージ
1日 18時間
マージ済み PR(30日)
21

説明

## 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、既存の HandlerWrapper.GetHandlerWrapper のオーバーロード、特に ILambdaSerializer を受け取る Func およびジェネリックな Func のオーバーロードを読みます。現在のオーバーロード選択が非同期ハンドラーをどのように処理するかを確認し、続いて、提案されたオーバーロードによって、非同期処理が実行される前にハンドラーが終了してしまうことが防止されることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, csharp
領域
backend, cloud
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。