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

Recurrent NSInvocationOperations on an NSOperationQueue?


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

I'm trying to automatically re-queue an NSInvocationOperation to an NSOperationQueue every n seconds, but I can't get it to work.

For the purpose of serializing exclusive access to a specific resource, I have a single-threaded background NSOperationQueue with parameters:
- maxConcurrentOperationCount = 1
- qualityOfService = NSOperationQualityOfServiceBackground

I enqueue a resource-accessing status-sensing NSInvocationOperation onto the queue.
- If it detects good status, it re-queues itself to the queue *after 60 seconds*. In the meantime, the queue should be empty for user jobs that may wish to access the resource.
- If it detects bad status, it performs whatever actions necessary (may take many minutes). When done, it re-queues itself to the queue *after 60 seconds*.

I've tried -performSelector:withObject:afterDelay: within the NSInvocationOperation but it does nothing. If I directly re-queue the NSInvocationOperation, of course it runs again immediately. Is there a way to do this?
-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:
    • Re: Recurrent NSInvocationOperations on an NSOperationQueue?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Tech update avoiding legacy code
  • Next by Date: Referring to self in property initializer
  • Previous by thread: Re: mouseMoved/mouseDragged while right button is down
  • Next by thread: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Index(es):
    • Date
    • Thread