Re-initializing the PoshRuntime #2131
-
Is is safe to re-initialize the PoshRuntime multiple times in a process's lifetime? I have a use case where a process needs to communicate using Iceoryx but also needs to live across multiple Roudi process lifetimes. I have seen there exists PoshRuntime::setRuntimeFactory, so I could potentially use this to create and destruct runtimes on the heap. However I am a bit concerned about doing this as there is no documentation on it, and it seems like there are more than a couple static variables that exist throughout the codebase which may not play well with multiple different PoshRuntime instances. One point of evidence that this might be ok is that it does look like one of the tests creates multiple PoshRuntime instances are created on the heap... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It is not officially supported but we created a mechanism for integration tests. This is an implementation detail and can change any time. May I ask why you can't keep RouDi running? |
Beta Was this translation helpful? Give feedback.
We have some ideas to run multiple RouDi. I think you also asked for this feature. With that we would need to change how the runtime works and how the user creates the publisher and subscriber, i.e. by getting rid of the static runtime. It will be some work but definitely feasible.
In the short term there is no official support for this but as you already found out, there is an undocumented feature that is used for testing. I cannot recommend to use it since we don't want to commit to such an API or give guarantees but I also cannot prevent anybody from using it. It's just not guaranteed to keep working the way it works now.