i have a mobile app code that gets data from a remote web service.
i have set the task to get data and update the corresponding UI elements in various tabs
This is my current code
From the above code, there are 5 tasks corresponding to 5 tabs in the app
while the tasks are running, I will show a loading icon in all 5 of the tabs. Once the task is done, the loading icon of the said task will be hidden
Everything is running fine, but there will be random times where either the server or some other stuff causing the task to run very long.
What I want is, to have a timeout after maybe 2mins, if the task is not completed I want to show a connection issue message at the corresponding tabs.
i have set the task to get data and update the corresponding UI elements in various tabs
This is my current code
C#:
var doughnutData = GetDoughnutDataAsync(filters);
var barData = GetBarDataAsync(filters);
var trendlineData = GetTrendLineDataAsync(filters);
var categoryData = GetCategoryDataAsync(filters);
var clientData = GetClientDataAsync(filters);
await Task.WhenAll(doughnutData, barData, trendlineData, categoryData, clientData);
From the above code, there are 5 tasks corresponding to 5 tabs in the app
while the tasks are running, I will show a loading icon in all 5 of the tabs. Once the task is done, the loading icon of the said task will be hidden
Everything is running fine, but there will be random times where either the server or some other stuff causing the task to run very long.
What I want is, to have a timeout after maybe 2mins, if the task is not completed I want to show a connection issue message at the corresponding tabs.