如何确定在队列中等待的操作的进展如何? [英] How to determine progress of pending operations in queue?

查看:167
本文介绍了如何确定在队列中等待的操作的进展如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用MSMQ队列处理很多操作上的XML数据文件。如果我正确理解该技术,任务将被传递到队列他们将在那里被处理程序得到。此外,如果有很多这样的任务,处理程序将捕获的任务一个接一个。因此,有一些刚刚铺设在队列中尚未完成的任务,等待处理。

I would like to use MSMQ queue to handle a lot of operations on XML data files. If I properly understand that technology, tasks will be passed to queue where they will get by handler. Also if there are a lot of such tasks, handler will catch tasks one by one. Therefore there are some pending tasks that just laying in queue and waits for handler.

所以也是我应该表现出的处理上载的XML文件在网站上的百分比进度。 现在的问题是我怎么能证明尚未完成的任务它真的没有一开始就被处理了这种进步。

So also I should show a progress of handling of uploaded XML files on website in percents. The question is how can I demonstrate such progress of pending tasks which really didn't start to be handled.

反映处理某些任务进度的常规方法是回到请求服务的完整性,通过一些象征性的百分比,该客户端是之前产生。然后,只写它的网站上。

The regular way of reflecting a progress of handling some task is to request service back for a percentage of completeness by some token, which client was generated before. And then just write it on the site.

推荐答案

您可以打开一个队列为双向,让处理器传递答案返回给发送者。

You can open a queue as bi-directional and let the handler pass an answer back to the sender.

MSMQ是精神疾病要使用一个不同的过程,甚至可以在不同的计算机上运行。 这样的方式卸载长时间运行作业断当前进程,例如一个服务

MSMQ is ment to be used by a different process that can be run on even a different computer. This a way to offload long running jobs off the current process, as for example a service.

如果该服务停止,你的客户就不会知道这件事情,它甚至不应该关心的MSMQ保证的工作将完成。考虑多大的使用情况进行跟踪进度是在这种情况下? (除遵守该服务的可以的死)

If that service is down, your client will not know about it, it even shouldn't care as MSMQ "guarantees" the job will be done. Consider how much use tracking progress is in that case? (besides observing that the service could be dead)

如果你只是想要做一些简单的异步工作,我建议看看任务类,并留下MSMQ。

If you just to want to do some simple async work I suggest to look at the Task class and leave MSMQ.

这篇关于如何确定在队列中等待的操作的进展如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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