Archived

This forum has been archived. Please start a new discussion on GitHub.

agent that subscribes to and publishes multiple topics.

We would like to implement a distributed agent architecture for a System Health Management Testbed, using the IceStorm publish-subscribe service. The distributed system would usually involve 6 - 12 agents sharing data over about a dozen topics.

Are there any examples where individual applications publish several topics and subscribe to several topics at the same time? In the IceStorm example (clock)that comes with the ice software download, both the Publisher and the Subscriber classes inherit from Application. The Application class only allows one thread.

Comments

  • mes
    mes California
    Hi Chris,

    The Application class doesn't place any restrictions on the number of threads your program uses. Perhaps you're thinking of the fact that Application is a singleton class and therefore a program can only create one instance of it?

    Take care,
    - Mark
  • agent that subscribes to and publishes multiple topics

    Yes, how can I create multiple instances of a publisher or subscriber in a single application. The singleton class seems to prevent that (it causes an error).
  • marc
    marc Florida
    I don't understand what multiple publishers or subscribers have to do with the Ice::Application singleton class, and why it would prevent you from doing so. What error do you get exactly?

    Regardless of whether you use Ice::Application or initialize the communicator by hand, you simply subscribe to multiple topics or publish to different topics. There is no special trick here. Whether you use the main thread or create your own threads does not matter. What problem do you exactly have?