在 WCF 或 .Net Remoting 中调度通用任务

发布于 2024-08-31 18:09:03 字数 275 浏览 5 评论 0原文

我断断续续地研究了几天,但尚未找出实现以下目标的最佳方法。

我想在 C# 中定义一个接口或抽象类,它有一个关联的 Run 方法,类似于 Java 可运行接口。目标是拥有一个包含这些对象列表的共享队列。然后,各个客户端将能够派生自己的具体可运行类并将它们添加到服务器托管的队列中。客户端还可以将这些可运行对象从队列中弹出并任意执行它们。

这似乎在基于虚拟机的语言中是可行的,而不需要将任何具体实现放在共享程序集中,但到目前为止我还没有找到这样一个系统的工作示例。

有谁知道如何实现这一目标?

I've been researching for a couple days on and off, and have yet to figure out the best way to achieve the following goal.

I would like to define either an interface or abstract class in C# which has an associated Run method, similar to the Java runnable interface. The goal would be to have a shared queue which contains a list of these objects. Then individual clients would be able to derive their own concrete runnable classes and add them to the queue hosted by the server. Clients would also be able to pop these runnable objects off the queue and execute them arbitrarily.

This seems like it should be feasible in a VM based language without needing to place any of the concrete implementations in a shared assembly, but I have thus far had no luck finding a working example of such a system.

Does anyone know how this might be achieved?

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

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

发布评论

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

评论(1

没企图 2024-09-07 18:09:03

您可能想查看 Agatha 项目。它为 WCF 提供了一个简单的请求/响应层。至于添加新的“运行”实现,您将使用 IoC 容器或 MEF 来注册新端点。

You might want to check out the Agatha project. It provides a simple request/response layer for WCF. As far as adding new "Run" implementations, you would use an IoC container or MEF to register new endpoints.

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