Use a singleton completion queue

pull/5749/head
Jorge Canizales 9 years ago
parent db3bccade4
commit c5dd4d47aa
  1. 7
      src/objective-c/GRPCClient/private/GRPCCompletionQueue.m

@ -41,7 +41,12 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
@implementation GRPCCompletionQueue
+ (instancetype)completionQueue {
return [[self alloc] init];
static GRPCCompletionQueue *singleton = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
singleton = [[self alloc] init];
});
return singleton;
}
- (instancetype)init {

Loading…
Cancel
Save