Use Apple internal type for timeout

pull/12339/head
Muxi Yan 8 years ago
parent c7c8e3cb17
commit afa4700501
  1. 2
      src/objective-c/GRPCClient/GRPCCall.h
  2. 2
      src/objective-c/GRPCClient/private/GRPCChannel.h
  3. 4
      src/objective-c/GRPCClient/private/GRPCChannel.m
  4. 2
      src/objective-c/GRPCClient/private/GRPCHost.h
  5. 2
      src/objective-c/GRPCClient/private/GRPCHost.m
  6. 2
      src/objective-c/GRPCClient/private/GRPCWrappedCall.h
  7. 2
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m

@ -172,7 +172,7 @@ extern id const kGRPCTrailersKey;
/**
* The timeout for the RPC call in milliseconds. If set to 0, the call will not timeout.
*/
@property UInt64 timeout;
@property NSTimeInterval timeout;
/**
* The container of the request headers of an RPC conforms to this protocol, which is a subset of

@ -63,6 +63,6 @@ struct grpc_channel_credentials;
- (nullable grpc_call *)unmanagedCallWithPath:(nonnull NSString *)path
serverName:(nonnull NSString *)serverName
timeout:(UInt64)timeout
timeout:(NSTimeInterval)timeout
completionQueue:(nonnull GRPCCompletionQueue *)queue;
@end

@ -182,7 +182,7 @@ static grpc_channel_args *BuildChannelArgs(NSDictionary *dictionary) {
- (grpc_call *)unmanagedCallWithPath:(NSString *)path
serverName:(NSString *)serverName
timeout:(UInt64)timeout
timeout:(NSTimeInterval)timeout
completionQueue:(GRPCCompletionQueue *)queue {
grpc_slice host_slice;
if (serverName) {
@ -193,7 +193,7 @@ static grpc_channel_args *BuildChannelArgs(NSDictionary *dictionary) {
gpr_inf_future(GPR_CLOCK_REALTIME) :
gpr_time_add(
gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_millis(timeout, GPR_TIMESPAN));
gpr_time_from_millis((int64_t)(timeout * 1000), GPR_TIMESPAN));
grpc_call *call = grpc_channel_create_call(_unmanagedChannel,
NULL, GRPC_PROPAGATE_DEFAULTS,
queue.unmanagedQueue,

@ -55,7 +55,7 @@ struct grpc_channel_credentials;
/** Create a grpc_call object to the provided path on this host. */
- (nullable struct grpc_call *)unmanagedCallWithPath:(NSString *)path
serverName:(NSString *)serverName
timeout:(UInt64)timeout
timeout:(NSTimeInterval)timeout
completionQueue:(GRPCCompletionQueue *)queue;
// TODO: There's a race when a new RPC is coming through just as an existing one is getting

@ -121,7 +121,7 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil;
- (nullable grpc_call *)unmanagedCallWithPath:(NSString *)path
serverName:(NSString *)serverName
timeout:(UInt64)timeout
timeout:(NSTimeInterval)timeout
completionQueue:(GRPCCompletionQueue *)queue {
GRPCChannel *channel;
// This is racing -[GRPCHost disconnect].

@ -77,7 +77,7 @@
- (instancetype)initWithHost:(NSString *)host
serverName:(NSString *)serverName
path:(NSString *)path
timeout:(UInt64)timeout NS_DESIGNATED_INITIALIZER;
timeout:(NSTimeInterval)timeout NS_DESIGNATED_INITIALIZER;
- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)())errorHandler;

@ -244,7 +244,7 @@
- (instancetype)initWithHost:(NSString *)host
serverName:(NSString *)serverName
path:(NSString *)path
timeout:(UInt64)timeout {
timeout:(NSTimeInterval)timeout {
if (!path || !host) {
[NSException raise:NSInvalidArgumentException
format:@"path and host cannot be nil."];

Loading…
Cancel
Save