瀏覽代碼

Merge pull request #254 from cepages/issue_103_client_initializer_interface_compliance

Added requited designation to allow to create ServiceClient dynamically
Tim Burks 7 年之前
父節點
當前提交
ac74772da3
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Sources/SwiftGRPC/Runtime/ServiceClient.swift

+ 3 - 3
Sources/SwiftGRPC/Runtime/ServiceClient.swift

@@ -49,20 +49,20 @@ open class ServiceClientBase: ServiceClient {
   }
 
   /// Create a client.
-  public init(address: String, secure: Bool = true, arguments: [Channel.Argument] = []) {
+  required public init(address: String, secure: Bool = true, arguments: [Channel.Argument] = []) {
     gRPC.initialize()
     channel = Channel(address: address, secure: secure, arguments: arguments)
     metadata = Metadata()
   }
 
   /// Create a client using a pre-defined channel.
-  public init(channel: Channel) {
+  required public init(channel: Channel) {
     self.channel = channel
     metadata = Metadata()
   }
   
   /// Create a client that makes secure connections with a custom certificate.
-  public init(address: String, certificates: String, arguments: [Channel.Argument] = []) {
+  required public init(address: String, certificates: String, arguments: [Channel.Argument] = []) {
     gRPC.initialize()
     channel = Channel(address: address, certificates: certificates, arguments: arguments)
     metadata = Metadata()