是否可以在 UI 线程上运行quartz.net 作业?
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定你是如何运行的,但你可以:
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.
我不熟悉 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.