具有计时器事件的 CORBA 对象

发布于 2024-09-29 06:16:00 字数 245 浏览 2 评论 0原文

我有一个程序,它创建 CORBA 对象,这些对象订阅不同的事件(来自其他远程 CORBA 对象),并记录在数据库中接收到的每个事件。问题是我还希望该对象每分钟向另一个远程 CORBA 对象发送请求。

我该怎么做?

也许为每个创建的 CORBA 对象启动一个附加线程并使用它来 ping 我的对象?

或者也许我可以使用 POA 并告诉它向我的所有对象发送消息(但不阻塞)?或者从 POA 请求信息并进行自己的调用(但也不会阻塞)?

I have a program that creates CORBA objects which are subscribed for different events (from other remote CORBA objects) and log every event that thay receive in a database. The problem is that I also want this objects to send request to this other remote CORBA object every minute.

How can I do this?

Maybe start an additional thread for every created CORBA object and use it to ping my objects?

Or maybe I can use POA and tell it to send a message to all my objects (but without blocking)? Or request information from POA and make my own invocation (but also without blocking)?

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

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

发布评论

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

评论(1

零度° 2024-10-06 06:16:00

我将启动一个计时器线程,在循环中等待一分钟,当时间到时,在循环中调用所有已注册的对象(前提是该调用不需要线程一般无法提供的参数)。

然后您所要做的就是将您想要每分钟调用的所有对象引用放入一个列表中(确保适当地保护对列表的访问)。

I would start a timer thread that waits a minute in a loop and when the time is up calls all registered objects in a loop (providing that the call needs no arguments that the thread can not provide generically).

All you have to do then is to put all the object references you want to call every minute into a list (make sure to protect the access to the list appropriately).

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