Asynchronous programming design pattern

后端 未结 4 1909
失恋的感觉
失恋的感觉 2021-02-10 23:29

I\'m working on a little technical framework for CF.NET and my question is, how should I code the asynchronous part? Read many things on MSDN but isn\'t clear for me.

So

4条回答
  •  日久生厌
    2021-02-10 23:35

    On BeginExecute you have to start the asynchronous operation (possibly start execute in a separate thread) and return as quick as possible. Execute has to call the AsyncCallback at the end of all operations so that who use the async operation gets aware and get the result. EndExecute has to stop a previously started async operation (possibly interrupting the thread launched by BeginExecute).
    Without more details this is the best I can do.

提交回复
热议问题