【发布时间】:2018-05-12 16:10:19
【问题描述】:
我们有一个运行良好的本地解决方案 (c#.net),现在我们正在尝试迁移到云 (azure) 以利用自动缩放功能。
我们遇到了一些问题,其中之一是后台任务监控。
我们创建一个新的长时间运行的任务,如下所示:
1- Write the C# code that will be run on background
2- Run it using our own JobFramework in another thread and storing some handle for the running task
3- Keep checking the progress of the task using the handle
现在假设我们在扩展后有 2 个实例,第一个运行一些任务。
如果用户使用句柄检查任务的状态并且请求转到第二台机器,我们将得到意想不到的结果,因为它在第一台机器的某个线程上运行。
有解决这个问题的建议吗?
【问题讨论】:
标签: c# multithreading cloud background-process scaling