从ASP.NET轮询长时间运行的Windows服务

时间:2022-04-28 03:07:30

We have an application that uses Lucene.NET within a windows service to reindex our app for search. Our admin section can trigger a full reindex in Lucene, and currently the only way to review its progress is through a log file written to disc.

我们有一个应用程序在Windows服务中使用Lucene.NET重新索引我们的应用程序进行搜索。我们的管理部分可以在Lucene中触发完整的重新索引,目前查看其进度的唯一方法是通过写入光盘的日志文件。

This is clunky. We'd like to poll the service to determine the reindexing progress.

这很笨重。我们想要轮询服务以确定重建索引进度。

Does anyone have any insight into this?

有没有人对此有任何见解?

1 个解决方案

#1


Named pipes would be the way I would do cross process communication in this instance, if both processes would be running on the same machine.

如果两个进程都在同一台机器上运行,那么命名管道将是我在此实例中进行跨进程通信的方式。

If both processes are on different machines, it gets hairier and will probably involve something along the lines of a web service communicating with the process and then asp.net calling the web service.

如果两个进程都在不同的机器上,它会变得更加繁琐,可能会涉及与进程通信的Web服务,然后是asp.net调用Web服务。

#1


Named pipes would be the way I would do cross process communication in this instance, if both processes would be running on the same machine.

如果两个进程都在同一台机器上运行,那么命名管道将是我在此实例中进行跨进程通信的方式。

If both processes are on different machines, it gets hairier and will probably involve something along the lines of a web service communicating with the process and then asp.net calling the web service.

如果两个进程都在不同的机器上,它会变得更加繁琐,可能会涉及与进程通信的Web服务,然后是asp.net调用Web服务。