delphi - Does "Long running method is done" have a design pattern? -


I have a way that takes a long time to complete and wants to check regularly has been done. This is that I came up with (simplified code, Delphi 2007):

  type IWaitForDone = interface function ISDone: boolean; End; Function TSomeClass.doSomethingThatTakesLong: IWaitForDone; Start the result: = TClassThatDoesIt.Create; End; War Waiter: IWaitForDone; Start Waiter: = SomeClass.doSomethingThatTakesLong; While not a waiter Waiter: = zero; End; It is possible in context that calling is exactly what is to be done in reality and what is true, when it is finished and goes wrong, even when parts Is done. Alternatively, it can only check if another thread is done with its work. I do not want to see this caller. 

I think I am not the first person to come into this kind of problem and this solution has already got a name (a design pattern?), But I could not find it. So what is it called?

I have seen it as a 'future' first. / P>

Here are some links:

This is done by an Oren Ini which is a generous one. Net developer on one side - Good to read your blog (where this is the link) If you are interested in coding Patrol, best practice etc ...

And this is the link It was yours, but I thought I would answer it with full answer.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -