Azure Webjobs:一个具有多个功能的作业,还是每个具有1个功能的作业?

编程入门 行业动态 更新时间:2024-10-11 19:22:51
本文介绍了Azure Webjobs:一个具有多个功能的作业,还是每个具有1个功能的作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在创建每个具有1个功能的多个Web作业与将几个功能绑定到一个或仅几个WebJob之间进行选择? 谢谢

How do I decide between creating several WebJobs with 1 function each and bundling several functions into one or only a few WebJobs? Thanks

推荐答案

您的问题没有直接答案.抱歉.

There is no straight answer to your question. Sorry.

通常,您可以按工作流或角色对功能进行分组.例如,如果您的工作流包含一个调整图像大小的功能,然后一个应用水印的功能和另一个复制图像的功能,则将所有功能放在一起是有意义的,因为它们是相关的.修改流程时,您更有可能更改所有这些内容.

Usually you group functions by workflow or role. For example if you have a workflow that contains a function that resizes an image, then a function that applies a watermark and another one that replicates the images then it makes sense to put all the functions together because they are related. You are more likely to change all of them when you modify the flow.

另一方面,您可能认为功能应该分开.除非您更改输入/输出,否则没有理由修改多个功能.但是,如果您需要更改多个功能,那么最终将编辑更多项目.

On the other hand, you might argue that functions should be separated. Unless you change the input/output, there is no reason to modify more than one function. However, if you need to change more than one function, you will end up editing more projects.

如您所见,这两个参数都有优点/缺点,而且实际上没有正确的答案.

As you see, both arguments have pros/cons and there is really no right answer.

尝试进行实验,看看哪种方法更适合您的解决方案.

Try to experiment and see which approach works better for your solution.

PS:我唯一能给出的指导原则是:如果函数真的很小(几行代码),则将它们放在同一个webjob中可能会更容易,因为维护多个程序集会产生相当大的开销.

PS: The only guideline that I can give is: if the functions are really small (a few lines of code), probably it is easier to put them in the same webjob because there is quite some overhead in maintaining multiple assemblies.

更多推荐

Azure Webjobs:一个具有多个功能的作业,还是每个具有1个功能的作业?

本文发布于:2023-11-28 07:52:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641552.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:作业   功能   多个   Azure   Webjobs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!