diff options
author | Muxi Yan <mxyan@google.com> | 2017-04-05 13:12:30 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-04-05 13:12:30 -0700 |
commit | 895f3d83da12664e59379d9ce6cccb8ab9f244b7 (patch) | |
tree | b6c3b992787dc3cd607138443a9cef9ff39b6f70 /src/objective-c/RxLibrary/GRXConcurrentWriteable.m | |
parent | 80b4a8af196524ebda6907a20361307fecd1a757 (diff) |
Support configuring dispatch queue in GRPCCall and below
Diffstat (limited to 'src/objective-c/RxLibrary/GRXConcurrentWriteable.m')
-rw-r--r-- | src/objective-c/RxLibrary/GRXConcurrentWriteable.m | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m index 08bd079aea..88aa7a7282 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m @@ -51,14 +51,20 @@ } // Designated initializer -- (instancetype)initWithWriteable:(id<GRXWriteable>)writeable { +- (instancetype)initWithWriteable:(id<GRXWriteable>)writeable + dispatchQueue:(dispatch_queue_t)queue { if (self = [super init]) { - _writeableQueue = dispatch_get_main_queue(); + _writeableQueue = queue; _writeable = writeable; } return self; } +- (instancetype)initWithWriteable:(id<GRXWriteable>)writeable { + return [self initWithWriteable:writeable + dispatchQueue:dispatch_get_main_queue()]; +} + - (void)enqueueValue:(id)value completionHandler:(void (^)())handler { dispatch_async(_writeableQueue, ^{ // We're racing a possible cancellation performed by another thread. To turn all already- |