Why not just a single timer and a queue of messages?
Tim
> -----Original Message-----
> From: realbasic-nug-bounces at lists dot realsoftware dot com
> [mailto:realbasic-nug-bounces at lists dot realsoftware dot com]On Behalf Of
> Eric Williams
> Sent: Sunday, December 30, 2007 10:59 PM
> To: REALbasic NUG
> Subject: Circular reference powers used for good?
>
>
> Hello list -
>
> I have a situation which, oddly enough, seems to call for a circular
> reference, and I wanted some feedback on whether it's a good idea or
> not.
>
> The app needs to send it self a slightly delayed message - say, after
> a few seconds. I'm planning to deploy a Timer that calls back to an
> object's HandleTimedAction method. It's possible that several of
> these little timers could be necessary at once, and I don't want to
> keep track of them if I don't have to.
>
> Can I set up the timer with a property "myself as Timer" to make sure
> it doesn't go out of scope? Then, in the Timer's Action event, I can
> set the myself property to nil and it should just evaporate after the
> event ends (because no other object will hold a reference to it).
>
> Does anybody see any problem with this approach? Incidentally, I'm
> considering the circular reference setup to avoid a potential stack
> overflow. :)
>
> Eric Williams
> Oxalyn Software
> http://software.oxalyn.com/
>
> AE Monitor
> http://software.oxalyn.com/AEMonitor/
>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.17.12/1203 - Release Date:
> 12/30/2007 11:27 AM
>
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.17.12/1203 - Release Date: 12/30/2007
11:27 AM
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|