I have a method which runs asynchronously and returns results through a completion handler. The method call itself returns "immediately" but the completion handler can take some time to be called.

I would like to serialize calls to this method such that it will not run twice if the completion handler hasn't been handled in the previous call.

Right now I am using a flag

```
-(void)myAsyncMethod:(void(^)(NSError *error))block
{
  if(_isRunning) 
  {
     return; // would like to queue the call
  }
  _isRunning = YES;
  // do some long running async work which themselves can have completion handlers and run asynchronously

  // look for ever place with a call to "block"

  _isRunning = NO;
  block(error); 
}

```

Is there a way to do this without using flags inside the method call using dispatch\_sync,async etc.