Jump to content

Sleep Delay In UniGui Application


mos

Recommended Posts

As far as I understand, Unigui is a multithreaded system,

so you can sleep in all spawned threads, that is in uniMainModule

and all forms which run under it.

 

But in the ServerModule it is a different issue, and I would only use

sleep in the OnHTTP events, which probably spawn a new thread.

 

Sleeping elsewhere in the ServerModule will probably halt the server,

in the sense that new threads/connections/sessions may not be started,

but I have not tested this, and also I do not see the point of sleeping

other places, like in Create or the other events.

 

If doing HTTP longpolling, you have to sleep in the OnHTTP events,

to keep the connection.

Link to comment
Share on other sites

Can I call Sleep(500); in a UniGui application if I need to add a delay inside a for loop, or do I need use some other UniGui function instead?

 

The actual question is why do you need a sleep delay inside a loop? If you are waiting for something to "happen" or "catch up" before you can continue then you need to have to look at your design again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...