harishrohokale Posted March 16, 2016 Posted March 16, 2016 Can anyone explain what is the difference between TUniTimer and TUniThreadTimer? We have observed few differences: 1. TUniTimer supports ClientEvent, TUniThreadTimer does not. 2. TUniTimer has option to set RunOnce, TUniThreadTimer does not. Quote
Administrators Farshad Mohajeri Posted March 16, 2016 Administrators Posted March 16, 2016 TUniTimer has a client side component which is a Javascript timer. When timer event occurs on client it sends an Ajax request and server will serve it in a server side handler. It works synchronously with its session and can interact with visual controls. TuniThreadTimer is a server side timer. It runs in server in its own thread and has no connection to client side. It is not bound to any session. It can be used to run server side tasks and other internal tasks. 1 Quote
AlbertoVesx Posted March 24, 2017 Posted March 24, 2017 Is it possible to set Unitimer1.enabled := False from Tunitimer.ontimer event? When I do this, client keeps sending ajax request . Should I stop it using javascrip using session.addjs(); could someone show me how to to do this? Quote
Administrators Farshad Mohajeri Posted March 24, 2017 Administrators Posted March 24, 2017 Is it possible to set Unitimer1.enabled := False from Tunitimer.ontimer event? When I do this, client keeps sending ajax request . Should I stop it using javascrip using session.addjs(); could someone show me how to to do this? Yes,you can but if your timer is too fast it may take a while until it stops. What is the interval of your timer? You can also set ChainMode to True to see if it makes any difference. Quote
AlbertoVesx Posted March 27, 2017 Posted March 27, 2017 Hi, 5 seconds.My idea is to stop unitimer at the begining of the event and restart it after finish his function. Something like this: ontimEvent begin ontimer.enabled := False; somefunctionshere(); ontimer.enabled := True; end; But the ontimer keeps adding events Quote
Administrators Farshad Mohajeri Posted March 29, 2017 Administrators Posted March 29, 2017 Hi, 5 seconds.My idea is to stop unitimer at the begining of the event and restart it after finish his function. Something like this: ontimEvent begin ontimer.enabled := False; somefunctionshere(); ontimer.enabled := True; end; But the ontimer keeps adding events Use ChainMode = True for this. In this mode timer will not create more events until pending event is handled. 1 Quote
mos Posted November 5, 2017 Posted November 5, 2017 If I want to update a TUniTreeView via a thread with data from a database. Would I need to use a TUniThreadTimer to retreive the data from the DB into some internal list and then have a TUniTimer process this list and update the treeview? I assume I can't just use a TUniTimer by itself to retrieve the data from the DB and update the treeview? Quote
zilav Posted November 5, 2017 Posted November 5, 2017 I assume I can't just use a TUniTimer by itself to retrieve the data from the DB and update the treeview? You can. Get the data and update tree in TUniTimer event, it is called from client but executed on the server. Quote
Tokay Posted November 17, 2017 Posted November 17, 2017 May by better way is to rename components to TServerTimer and TClientTimer respectively. And set both old components as depricated. 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.