是否可以在 UI 线程上运行quartz.net 作业?

发布于 2024-08-03 00:25:32 字数 119 浏览 14 评论 0原文

我使用 Watin 进行浏览器测试,它必须在 UI 线程上运行。

我想使用 Quartz.NET 安排一个作业,但无法找到在 UI 线程上运行它的方法(使用 WPF 应用程序)

有什么想法吗?

I'm using Watin for browser testing, which has to run on the UI thread.

I want to schedule a job using Quartz.NET but can't work out a way to run it on the UI thread (using a WPF application)

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝眸 2024-08-10 00:25:32

我不确定你是如何运行的,但你可以:
1. 无论您在何处运行 watin,都从内部启动调度程序,然后通过 UI 线程远程连接到它来调度作业。
2. 将调度程序作为 Windows 服务启动,然后通过 UI 线程远程连接到它来调度作业。
3. 编写一个简单的控制台应用程序来启动调度程序并通过远程处理公开它。然后从 UI 线程连接到它来安排您的作业。

看看我之前用一些代码示例写的这个答案:
https://stackoverflow.com/questions/1356789/quartz-net-with- asp-net/.希望它会有用。

I'm not sure how you're running watin but you could:
1. Start the scheduler from inside wherever you are running watin and then connect to it via remoting from the UI thread to schedule the job.
2. Start the scheduler as a windows service and then connect to it via remoting from the UI thread to schedule the job.
3. Write a simple console app that starts the scheduler and exposes it via remoting. Then connect to it from the UI thread to schedule your job.

Take a look at this answer I wrote up earlier with some code samples:
https://stackoverflow.com/questions/1356789/quartz-net-with-asp-net/. Hopefully it will be useful.

静谧 2024-08-10 00:25:32

我不熟悉 Quartz.NET,但 Java 版本提供了 ThreadPool 接口,可以实现该接口来实现自定义线程池实现。我不明白为什么你想在已经专用于另一个任务的 UI 线程中运行它。

I am not familiar with Quartz.NET but the Java version gives ThreadPool interface which can be implemented to make custom threadpool implementations. I don't understand why you would want to run it in a UI thread which is already dedicated to another task.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文