aws / aws/aws-lambda-runtime-interface-emulator
Async (Event) Function Invocation Emulation?
- Ngôn ngữ chính
- Go
- Star
- 1.1k
- Fork
- 118
- Merge trung bình
- 42 phút
- Pull request đã merge (30 ngày)
- 2
Mô tả
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện request curl đã được ghi lại đối với emulator, sử dụng header X-Amz-Invocation-Type: Event và một function chạy trong vài phút. Kiểm tra HTTP invocation entry point và so sánh hành vi của nó với RequestResponse. Hoàn thành khi Event trả về gần như ngay lập tức trong khi function vẫn tiếp tục chạy, mà không thay đổi hành vi đồng bộ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- go
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100