AWS Lambda:异步C#处理程序 [英] AWS Lambda: async C# handler

查看:84
本文介绍了AWS Lambda:异步C#处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWS文档指出

在AWS Lambda的C#函数中使用异步

Using Async in C# Functions with AWS Lambda

如果您知道自己的Lambda函数将需要长时间运行,例如将大文件上传到Amazon S3或读取大数据流来自DynamoDB的记录,您可以利用异步/等待图案.通过创建具有此签名的处理程序,Lambda将同步执行功能,最多等待5分钟返回或超时之前执行完成.

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.

我觉得Lambda会很困惑

I feel very confused Lambda will

同步执行该功能,最多等待5分钟

Lambda支持最多15分钟的处理时间.这是否意味着如果我在处理程序上放置异步,那么我只能在5分钟内处理一个事件?

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?

推荐答案

当时AWS支持的最终答案:

The final answer of AWS support at the time:

  • 该文档不是最新的.它最多应在15分钟的超时下运行(取决于Lambda函数配置)
  • 异步修改器不会更改AWS的行为,它们只会等待它.
  • 行为差异仅在.NET方面

这篇关于AWS Lambda:异步C#处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆