node.js - 将 EventEmitter 与 NodeJ 和 Azure 函数一起使用
问题描述
鉴于 Azure Functions 的无服务器特性,是否可以在 NodeJS/Typescript 中为 Azure Functions 使用事件发射器?对于高吞吐量场景,可能是每天对单个 Azure 函数终结点的数百万个请求,我想确保我不会以孤立事件告终。
解决方案
您可以利用Azure Event GridEventEmitter
,这是您的方案的内存中的分布式表亲。
这是您可以比较这些的方法
EventEmitter
您将拥有一个事件网格主题,而不是一个对象- 您将拥有一个事件处理程序,而不是一个侦听器
- 而不是
.emit()
,您POST
到自定义主题的端点 - 而不是
.on()
,您使用事件过滤
至于规模,Event Grid 为您提供了覆盖,因为它是为此类用例设计的。
此外,Event Grid 具有内置的重试功能,并且还支持死信。
推荐阅读
- pandas - 基于逗号扩展行并映射到pandas python中的另一行
- datatable - DATATABLE 的翻译问题
- javascript - 如何在 Google Chrome 中获取“浏览器内容宽度”的宽度?
- three.js - 在 Aframe 场景中使用 TransformControls 会导致错误
- javascript - 使用 Java Script 或 Apps Script 将视频上传到 YouTube
- php - 如何根据输入单选表单中选择的值分配 2 个名称?
- reactjs - 使用静态返回 true 或 false 反应备忘录比较功能
- flutter - Size 对象的渲染是什么?
- c# - LINQ 在选择中选择
- python - 为什么只有在我单击时才会显示圆圈,但在代码加载后仍会受到物理影响?