Jump to content
Registration disabled at the moment Read more... ×
Sign in to follow this  
wuwuxin

Is there any potential issue to create an instance of Data Module during Unit Initialization?

Recommended Posts

I have a data module that includes HTTPRIO - is there any potential issue to create an instance of that data module during its parent Unit initialization, and destroy the instance during its parent Unit finalization?

Share this post


Link to post

I am curious - why would you not create it when you need it?
I checked our code, and we typically create on demand per thread.

Share this post


Link to post
1 hour ago, Lars Fosdal said:

I am curious - why would you not create it when you need it?
I checked our code, and we typically create on demand per thread.

Hi @Lars Fosdal  Thank you for the advice.  The web service server I need to access -  has a time out for user session (which simple string is used for SessionID), and I need a separate thread to keep heartbeating the session (by calling a dummy method using the SessionID) to keep it from timeout.  I need to keep the session live for some reason.

Share this post


Link to post

In that case, I would have created a worker thread (or threads) that have a private RIO, work in, work out queues, and a default heartbeat ping loop method that is called when the work in queue is empty .

  • Thanks 1

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×