Hi everyone, im using a code to make things async, and it works perfectly.
Application.StartPolling(1000)
Application.StartTask(Function()
‘stuff here
End Function)
Application.Update(Me)
Application.EndPolling()
However, only if I enforce an update on the page (Me.Update()) the async is terminated, or the async data is demonstrated, how can I do this?
I’m currently using a 1 second timer that does Me.Update(), but this is not the most efficient way, and it slows down the server. Does anyone have better ways to do this?
Hi Ruben
Could you please explain what do you whant to achieve ?
Can you attach a runnable sample that show us how this affect?
regards
Hi Ruben,
I don’t think you need to use polling unless you have websockets disabled.
this is the general process for retrieving data from a db and updating the UI:
Application.StartTask(() => { // perform some long-running db fetch. var data = GetDataFromDB(); // apply changes to the ui. this.labelData.Text = data.Text; // push a websocket update to the client with the UI changes. Application.Update(this); });
You can find more info here:
https://docs.wisej.com/docs/concepts/background-tasks#update-the-ui
HTH,
Levie
Please login first to submit.