Re: scheduling order
jon klein <[email protected]>
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
On Dec 16, 2003, at 1:20 PM, Marcin Pilat wrote: > Direct call: > > If RunMeFirst directly calls the RunMe method, then obviously the > evaluation order of the objects’ RunMe method is preserved based on > the RunMeFirst method. > > Schedule call: > > If RunMeFirst calls the scheduler to schedule the RunMe method after a > fixed time (eg. 1) then the evaluation order of RunMe is independent > on the evaluation order of RunMeFirst. I'm not sure that I fully understand the problem you're having, but I think what you're describing is the expected behavior. I also see how it could be problematic. In general, the execution order of things scheduled for the same time by the breve engine is undefined. So if you have two objects scheduling a method call for the same time, you can't rely on one being called before the other. This applies to other methods the engine calls as well, such as the "iterate" method. When execution order is important, generally the best thing to do is call the methods explicitly from another object which will manage the execution (for example, the Controller object might be used). So instead of scheduling RunMe for both of the objects, you would schedule a call for the manager object, which will in turn call the RunMe method for both objects. That said, I see how it could become tedious--it should be relatively straightforward to change the order of the scheduled method calls in breve, so I'll look into that. - jon klein _______________________________________________ breve mailing list [email protected] http://www.spiderland.org/mailman/listinfo/breve