AWS Lambda: async C# handler

隐身守侯 提交于 2021-01-02 06:45:35

问题


The AWS document states that

Using Async in C# Functions with AWS Lambda

If you know your Lambda function will require a long-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern. By creating a handler with this signature, Lambda will execute the function synchronously and wait a maximum of 5 minutes for execution to complete before returning or timing out.

I feel very confused Lambda will

execute the function synchronously and wait a maximum of 5 minutes

When Lambda support up to 15 minutes of processing time. Does that mean if I put async on the handler, I can only process one event in 5 minutes?


回答1:


The final answer of AWS support at the time:

  • The document was not up to date. It should run at maximum 15 minute timeout ( depend on the Lambda function configuration )
  • The async modifier does not change how AWS behave, they will just await it.
  • The behaviour diference is only on the .NET side



回答2:


AWS recently changed the timeout for Lamdba. The execution timeout is changed from 5 minutes to 15 minutes.

https://aws.amazon.com/about-aws/whats-new/2018/10/aws-lambda-supports-functions-that-can-run-up-to-15-minutes/



来源:https://stackoverflow.com/questions/53953309/aws-lambda-async-c-sharp-handler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!