• 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: Recurrent NSInvocationOperations on an NSOperationQueue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recurrent NSInvocationOperations on an NSOperationQueue?


  • Subject: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • From: Carl Hoefs <email@hidden>
  • Date: Fri, 14 Aug 2015 19:15:47 -0700

> On Aug 14, 2015, at 7:01 PM, Ken Thomases <email@hidden> wrote:
>
> On Aug 14, 2015, at 8:43 PM, Carl Hoefs <email@hidden> wrote:
>
> You can use a serial GCD queue for the same purpose with my above suggestions.  But even if you want to keep using an NSOperationQueue, you can still use my first dispatch_after() suggestion.  It works just like your code except for replacing -performSelector:withObject:afterDelay: with dispatch_after().  This changes doesn't affect anything about how -doStatusChecks works.  It will still use your NSOperationQueue.
>
> You don't need to use the main GCD queue for my dispatch_after() suggestion, you can use a global concurrent queue.  Either works.

Ah, yes, that's a great solution! I was considering using a second NSOperationQueue for the status recheck task, but the dispatch_after() is lightweight and a perfect fit.
Many thanks,
-Carl



_______________________________________________

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:
    • Using alarm(3) on background NSOperationQueue threads
      • From: Carl Hoefs <email@hidden>
References: 
 >Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Ken Thomases <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Ken Thomases <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Next by Date: Automatically activate next window after one is closed
  • Previous by thread: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Next by thread: Using alarm(3) on background NSOperationQueue threads
  • Index(es):
    • Date
    • Thread