diff options
author | Muxi Yan <mxyan@google.com> | 2018-12-06 15:58:53 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-12-06 15:58:53 -0800 |
commit | f9e50322bf1d6be736b415831eea44130b9dedfe (patch) | |
tree | 7da2c7f0be6c10a05303e5215c1630df339744ea /src/objective-c/ProtoRPC | |
parent | eeced98fc556c6a5bc3a5dedc171c98747217078 (diff) |
batch fix
Diffstat (limited to 'src/objective-c/ProtoRPC')
-rw-r--r-- | src/objective-c/ProtoRPC/ProtoRPC.h | 16 | ||||
-rw-r--r-- | src/objective-c/ProtoRPC/ProtoRPC.m | 5 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index 287aa0369b..2e0400a323 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -28,6 +28,14 @@ NS_ASSUME_NONNULL_BEGIN /** An object can implement this protocol to receive responses from server from a call. */ @protocol GRPCProtoResponseHandler<NSObject> +@required + +/** + * All the responses must be issued to a user-provided dispatch queue. This property specifies the + * dispatch queue to be used for issuing the notifications. + */ +@property(atomic, readonly) dispatch_queue_t dispatchQueue; + @optional /** @@ -49,14 +57,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)didCloseWithTrailingMetadata:(nullable NSDictionary *)trailingMetadata error:(nullable NSError *)error; -@required - -/** - * All the responses must be issued to a user-provided dispatch queue. This property specifies the - * dispatch queue to be used for issuing the notifications. - */ -@property(atomic, readonly) dispatch_queue_t dispatchQueue; - @end /** A unary-request RPC call with Protobuf. */ diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 886e31ce58..0f63f72f53 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -75,7 +75,6 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing - (void)cancel { [_call cancel]; - _call = nil; } @end @@ -124,7 +123,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing #else { #endif - _dispatchQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL); + _dispatchQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL); } dispatch_set_target_queue(_dispatchQueue, handler.dispatchQueue); @@ -145,7 +144,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing copiedCall = _call; _call = nil; if ([_handler respondsToSelector:@selector(didCloseWithTrailingMetadata:error:)]) { - dispatch_async(_handler.dispatchQueue, ^{ + dispatch_async(_dispatchQueue, ^{ id<GRPCProtoResponseHandler> copiedHandler = nil; @synchronized(self) { copiedHandler = self->_handler; |