Browse Source

Add timeout argument to makeCall

ito_kyohei 7 years ago
parent
commit
0d67da98c7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Sources/SwiftGRPC/Core/Channel.swift

+ 2 - 1
Sources/SwiftGRPC/Core/Channel.swift

@@ -85,8 +85,9 @@ public class Channel {
   /// - Parameter host: the gRPC host name for the call. If unspecified, defaults to the Client host
   /// - Parameter timeout: a timeout value in seconds
   /// - Returns: a Call object that can be used to perform the request
-  public func makeCall(_ method: String, host: String = "") -> Call {
+  public func makeCall(_ method: String, host: String = "", timeout: TimeInterval? = nil) -> Call {
     let host = (host == "") ? self.host : host
+    let timeout = timeout ?? self.timeout
     let underlyingCall = cgrpc_channel_create_call(underlyingChannel, method, host, timeout)!
     return Call(underlyingCall: underlyingCall, owned: true, completionQueue: completionQueue)
   }