Thanks Martin! Cheers, Doru
On 13 Nov 2009, at 03:11, Martin McClure wrote: > Tudor Girba wrote: > >> >> This sounds interesting. Would it be possible to get a code sample >> (in >> particular of the waitUntil: method)? >> > > Sure. Here's the code we use in VW. I clearly didn't remember exactly > what we called it. :-) > We have a number of simpler methods that use this one, which is the > most > general case. Once you account for GemStone and VW-specific stuff, I > imagine this approach should work in Pharo. > > Regards, > > -Martin > > > gbtPauseUntil: validateBlock evaluatesReturning: expectedResult > maxWaitSeconds: maxWaitSeconds > "Evaluate validateBlock until it returns expectedResult or > maxWaitSeconds have passed, > pausing between evaluations. Return the last result of > validateBlock > value" > > | startTime result | > startTime := Time secondClock. > [result := validateBlock value = expectedResult] whileFalse: > [Time secondClock - startTime > maxWaitSeconds ifTrue: > [^result]. > (GbxDelay forMilliseconds: 50) wait]. > ^result > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project -- www.tudorgirba.com "Be rather willing to give than demanding to get." _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
