aws / aws/aws-lambda-runtime-interface-emulator
Async (Event) Function Invocation Emulation?
- Linguagem predominante
- Go
- Estrelas
- 1.1k
- Forks
- 118
- Merge médio
- 42min
- PRs com merge (30d)
- 2
Descrição
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.
Guia de contribuição
Direção de pesquisa
Comece reproduzindo a solicitação curl documentada no emulador, usando o cabeçalho X-Amz-Invocation-Type: Event e uma função que seja executada por vários minutos. Inspecione o ponto de entrada da invocação HTTP e compare seu comportamento com RequestResponse. Está concluído quando Event retornar quase imediatamente enquanto a função continuar em execução, sem alterar o comportamento síncrono.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- go
- Domínio
- api, backend
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100