Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async (Event) Function Invocation Emulation? #32

Open
doransmestad opened this issue Apr 19, 2021 · 2 comments
Open

Async (Event) Function Invocation Emulation? #32

doransmestad opened this issue Apr 19, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@doransmestad
Copy link

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.

@magraeber
Copy link

I have exactly the same issue.
@doransmestad have you found a solution?

@ghost ghost added the enhancement New feature or request label Aug 17, 2022
@mateokurti
Copy link

@valerena Sorry for directly tagging you into this but I saw you as the most active contributor. I'm also facing the same issue of not being able to use InvocationType Event and I saw this issue kind of inactive. Is there a way to have this working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants