G
Graham Allwood
I have a problem I need some help with. I am writing a Windows Forms
distributed app. I want my UI to be responsive so all calls to the business
objects which live in IIS I am calling asynchronously via a worker thread.
I have this all working but there are a couple of design / architecture
questions still hanging about. They are:
When making the async call I can keep the UI responsive but it leaves my
with different methods of getting the results out of the thread. I could use
a while loop testing the ThreadState, waiting for it to complete. Inside the
while loop I would call Application.DoEvents() and then Thread.Sleep(100).
The other way of getting the results would be by using a delegate for the
thread completion. The seconds option seems more elegant but is a little
harder to code. Is there a correct answer to my problem? Use a loop with
DoEvents or use a callback?
Can anyone help me please?
Regards
Graham
distributed app. I want my UI to be responsive so all calls to the business
objects which live in IIS I am calling asynchronously via a worker thread.
I have this all working but there are a couple of design / architecture
questions still hanging about. They are:
When making the async call I can keep the UI responsive but it leaves my
with different methods of getting the results out of the thread. I could use
a while loop testing the ThreadState, waiting for it to complete. Inside the
while loop I would call Application.DoEvents() and then Thread.Sleep(100).
The other way of getting the results would be by using a delegate for the
thread completion. The seconds option seems more elegant but is a little
harder to code. Is there a correct answer to my problem? Use a loop with
DoEvents or use a callback?
Can anyone help me please?
Regards
Graham