Re: Recurrent NSInvocationOperations on an NSOperationQueue?
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