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

Async (Event) Function Invocation Emulation?

Abierto
#32 2 comentarios 18 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Go
Estrellas
1.1k
Forks
118
Merge medio
42 min
PR fusionados (30 d)
2

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza reproduciendo la solicitud curl documentada contra el emulador, usando el encabezado X-Amz-Invocation-Type: Event y una función que se ejecute durante varios minutos. Inspecciona el punto de entrada de invocación HTTP y compara su comportamiento con RequestResponse. La tarea estará terminada cuando Event devuelva el control casi inmediatamente mientras la función continúa ejecutándose, sin cambiar el comportamiento síncrono.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
go
Área
api, backend
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.