Jump to content
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×