• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best pattern to follow for scheduling an event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best pattern to follow for scheduling an event


  • Subject: Re: Best pattern to follow for scheduling an event
  • From: glenn andreas <email@hidden>
  • Date: Thu, 8 Nov 2007 12:57:07 -0600


On Nov 8, 2007, at 12:43 PM, John Stiles wrote:

I think I'm not explaining myself well enough.

The typical pattern is that my method will get spammed a hundred times in quick succession. After the burst of calls has completed, I want to do fix-up. Technically, I could do my fix-ups after every single call, but that would probably be slow so I want to avoid it. This doesn't mean that the method will never get called again—much later on in app execution, it's quite possible that my method will suddenly get spammed again with hundreds of calls, and then I will want to do fix-ups again.


Then have you doFixUp: routine reallocate the m_deferredFixupTimer, so the next time that the "do something" trigger is hit, it can be scheduled again.


There is an inferred state that if m_deferredFixupTimer were nil, there is a pending cleanup, otherwise it means that the thing is currently clean (and the next time it made dirty, it will schedule a cleanup)

You could even tweak the date value to guarantee that, for example, the cleanup only happens once every 5 seconds... (if, for example, part of the cleanup is to tell the user something has been updated)



Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next generation of fractal art




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Best pattern to follow for scheduling an event
      • From: John Stiles <email@hidden>
References: 
 >Best pattern to follow for scheduling an event (From: John Stiles <email@hidden>)
 >Re: Best pattern to follow for scheduling an event (From: glenn andreas <email@hidden>)
 >Re: Best pattern to follow for scheduling an event (From: John Stiles <email@hidden>)
 >Re: Best pattern to follow for scheduling an event (From: glenn andreas <email@hidden>)
 >Re: Best pattern to follow for scheduling an event (From: John Stiles <email@hidden>)

  • Prev by Date: Re: NSUInteger not recognized
  • Next by Date: Re: Best pattern to follow for scheduling an event
  • Previous by thread: Re: Best pattern to follow for scheduling an event
  • Next by thread: Re: Best pattern to follow for scheduling an event
  • Index(es):
    • Date
    • Thread