|
|
|
@ -44,39 +44,49 @@ |
|
|
|
|
|
|
|
|
|
- (void)startNextInterceptorWithRequest:(GRPCRequestOptions *)requestOptions |
|
|
|
|
callOptions:(GRPCCallOptions *)callOptions { |
|
|
|
|
if (_nextInterceptor != nil) { |
|
|
|
|
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor; |
|
|
|
|
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{ |
|
|
|
|
[copiedNextInterceptor startWithRequestOptions:requestOptions callOptions:callOptions]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (void)writeNextInterceptorWithData:(id)data { |
|
|
|
|
if (_nextInterceptor != nil) { |
|
|
|
|
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor; |
|
|
|
|
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{ |
|
|
|
|
[copiedNextInterceptor writeData:data]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (void)finishNextInterceptor { |
|
|
|
|
if (_nextInterceptor != nil) { |
|
|
|
|
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor; |
|
|
|
|
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{ |
|
|
|
|
[copiedNextInterceptor finish]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (void)cancelNextInterceptor { |
|
|
|
|
if (_nextInterceptor != nil) { |
|
|
|
|
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor; |
|
|
|
|
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{ |
|
|
|
|
[copiedNextInterceptor cancel]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** Notify the next interceptor in the chain to receive more messages */ |
|
|
|
|
- (void)receiveNextInterceptorMessages:(NSUInteger)numberOfMessages { |
|
|
|
|
if (_nextInterceptor != nil) { |
|
|
|
|
id<GRPCInterceptorInterface> copiedNextInterceptor = _nextInterceptor; |
|
|
|
|
dispatch_async(copiedNextInterceptor.requestDispatchQueue, ^{ |
|
|
|
|
[copiedNextInterceptor receiveNextMessages:numberOfMessages]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Methods to forward GRPCResponseHandler callbacks to the previous object |
|
|
|
|