Aynchronous approach on event
-
Hi, Really need help and guidance. I need to pull data from server if there is available data, it shouldn't interrupt users action while data is being pulled. Scenario: Login to connect Pull data if available once complete, process wait for the next data.. I tried different approach but failed. New to asynchronous 1. The link below is working but failed and timeout expired in the middle. https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx[^] It's eating all my time. :confused: Really Appreciate
Dabsukol
-
Hi, Really need help and guidance. I need to pull data from server if there is available data, it shouldn't interrupt users action while data is being pulled. Scenario: Login to connect Pull data if available once complete, process wait for the next data.. I tried different approach but failed. New to asynchronous 1. The link below is working but failed and timeout expired in the middle. https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx[^] It's eating all my time. :confused: Really Appreciate
Dabsukol
This sounds like an ideal job for Rx. If I were you, that's the avenue I would explore.
-
Hi, Really need help and guidance. I need to pull data from server if there is available data, it shouldn't interrupt users action while data is being pulled. Scenario: Login to connect Pull data if available once complete, process wait for the next data.. I tried different approach but failed. New to asynchronous 1. The link below is working but failed and timeout expired in the middle. https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx[^] It's eating all my time. :confused: Really Appreciate
Dabsukol
A very simple one would be to create a task and run it,
Task.Run(async () =>
{
// Your code to load the content with awaits
// To put it on a separate thread
});Otherwise, you can always consider using asynchronous programming model[^]. In which you create methods, functions with async modifiers and then use the awaits to continue processing until the work (job, whatever) has been done.
public async void getData(){
// Assume Task GetDataAsync() { gets the data from server }
app.IntVariable = await server.GetDataAsync(); // await would fetch the int value
}Also, since the error is Time out I would suggest that you configure your server also. There may be a problem with that, Timeout would occur regardless of async or sync programming being used.
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
Hi, Really need help and guidance. I need to pull data from server if there is available data, it shouldn't interrupt users action while data is being pulled. Scenario: Login to connect Pull data if available once complete, process wait for the next data.. I tried different approach but failed. New to asynchronous 1. The link below is working but failed and timeout expired in the middle. https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx[^] It's eating all my time. :confused: Really Appreciate
Dabsukol
dabuskol wrote:
it shouldn't interrupt users action while data is being pulled.
What kind of app is it? WinForms, WPF, web, mobile? /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
-
dabuskol wrote:
it shouldn't interrupt users action while data is being pulled.
What kind of app is it? WinForms, WPF, web, mobile? /ravi
My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
-
Hi, Really need help and guidance. I need to pull data from server if there is available data, it shouldn't interrupt users action while data is being pulled. Scenario: Login to connect Pull data if available once complete, process wait for the next data.. I tried different approach but failed. New to asynchronous 1. The link below is working but failed and timeout expired in the middle. https://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx[^] It's eating all my time. :confused: Really Appreciate
Dabsukol