aws / aws/aws-lambda-runtime-interface-emulator

Async (Event) Function Invocation Emulation?

オープン
#32 コメント 2 件 リアクション 18 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Go
スター
1.1k
フォーク
118
平均マージ
42分
マージ済み PR(30日)
2

説明

Hello there! First off, thank you for making this emulator, it is really helpful for testing and development.

My question: is there a way to run the function invocation asynchronously? As far as I can tell, right now the HTTP request to the emulator results in a blocking call (i.e. no HTTP response until the function completes). This is helpful for testing the `RequestResponse` invocations, but causes issues with code using `Event` invocations (https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax).

In other words, I would expect the follow curl command to return almost immediately even if the "lambda" started takes a few minutes to complete.

```
curl -v -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -H "X-Amz-Invocation-Type: Event" -d '{}'
```

Not having this unfortunately breaks code that relies on the `Event` (async) behavior. We can of course thread/async those calls in our code, but it breaks the emulation we were hoping for.

Am I missing something, or is this indeed currently not covered by the emulator? If not covered, would a pull request to add it be welcome?

Thanks.

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

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

調査の方向性

まず、X-Amz-Invocation-Type: Event ヘッダーと、数分間実行される関数を使用して、エミュレーターに対する文書化された curl リクエストを再現します。HTTP invocation entry point を調査し、その動作を RequestResponse と比較します。Event がほぼ即座に返る一方で関数は実行を継続し、同期動作が変更されていなければ完了です。

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

評価

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

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

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