多个客户端到单个 WF 服务
Windows 工作流服务是否允许多个客户端使用一项服务?基本上我想做的是:构建一个 WF 服务,允许客户端“订阅服务”,然后当某些事件触发处理程序时,它将数据广播到每个客户端。因此,基本上某些事情将在后台处理,然后当服务接收到一个小字符串时,它会通过回调将该字符串广播到每个客户端。
因此,我首先需要弄清楚的是,我是否有一个具有向世界公开的 Subscription() 方法的服务,并且如果我有 3 个客户端调用该方法,则存储有关其回调端点和实现的信息以保留未来的数据”广播”;所有这些都可以在一项 WF 服务中实现吗?如果是这样,我如何在广播回调期间引用我的客户?
Do Windows Workflow Services allow multiple clients to one service? Basically what I am trying to do is this: construct a WF service that allows clients to "subscribe to the service" and then when certain events trigger a handler, it broadcasts data to each client. So basically something is going to process in the background and then when the services receives, lets say a small string, it broadcasts that string to each client via callbacks.
So what I need to figure out first is if I have a service with a Subscription() method exposed to the world and if I have let's say 3 clients call that method, store information about their callback endpoint and implementation to retain for future data "broadcasts"; can all of this happen in one WF service? If so, how do I reference my clients during broadcast callbacks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过在客户端中保存回调服务的实现来解决这个问题。在实际服务中,我有
subscribe()
和unsubscribe()
服务方法,它们将客户端端点 URI 作为参数之一。对其他参数进行一些身份验证后,URI 将保存到客户端池集合中。为了向所有客户端进行多播,我迭代 URI 集合并为每个 URI 执行回调。I resolved this by saving implementing callback services in the client. On the actual service I have
subscribe()
andunsubscribe()
service methods that take in the clients endpoint URI as one of the parameters. After some authentication on other parameters, the URI is saved to a client pool collection. To do multicasts back to all clients, I iterate through URI collection and perform callbacks for each URI.