Creating multiple Writers under single publsher that work asynchronously and publish data asynchronously after different time.

4 posts / 0 new
Last post
Offline
Last seen: 3 years 8 months ago
Joined: 05/31/2017
Posts: 2
Creating multiple Writers under single publsher that work asynchronously and publish data asynchronously after different time.

I have created multiple data writers with different topic names under a single publisher. I want sleep time for every writer to be different and they should independantly write data after the timeout which is different for each writer. Is it possible ? If yes then please provide tutorial or code for reference. Thanks

Organization:
Offline
Last seen: 2 months 3 weeks ago
Joined: 02/11/2016
Posts: 143

Hey,

What seems to be the problem?

I mean, what you're describing is a multithreaded application where each thread uses a different writer to write when it wants to.

In java the simple (although bad) way is to:

1. Create Runnables (basically classes that implement Runnable).
2. Initialize said runnables with their respective writer

3. Start said runnables in new threads.

What am I missing?

 

Roy.

Offline
Last seen: 3 years 8 months ago
Joined: 05/31/2017
Posts: 2

Hey thanks for the reply. Actually I had the plans to make my application multi threaded in the similar way you described. I just wanted to know if RTI_CONNEXT has inbuilt support functions or methods which may make the task easy. Else  I will be making threads manually.

Gerardo Pardo's picture
Offline
Last seen: 2 months 4 weeks ago
Joined: 06/02/2010
Posts: 594

Hi,

By "inbuilt support functions or methods  which may make the task easy" do you mean (1) some "operating system" portability layer that allows the same code to run indifferent platforms (e.g. POSIX versus Windows). Or (2) some higuer level constructs where yyou can schedule functions to be called at different rates?

RTI Connext does have (1) but it is an internal API we are curently not exposing.

There are also some facilities for (2). In the upcoming version we will be including something that helps schedule the processing of incoming data on thread pools, but we are not exposing anything to help with the use case of periodical scheduling of activities...

Gerardo