Skip to content

Commit

Permalink
Add timeout argument to makeCall
Browse files Browse the repository at this point in the history
  • Loading branch information
KyoheiG3 committed May 22, 2018
1 parent 8941a85 commit 0d67da9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/SwiftGRPC/Core/Channel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 0d67da9

Please sign in to comment.