From a9bd6cdc959ccd44bf2976491b043f8bf8f7745e Mon Sep 17 00:00:00 2001 From: Ali Moazenzadeh Date: Thu, 12 Aug 2021 14:35:37 +0430 Subject: [PATCH 1/2] Make path available in ClientCalls --- Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift | 5 +++++ Sources/GRPC/ClientCalls/ClientCall.swift | 3 +++ Sources/GRPC/ClientCalls/ClientStreamingCall.swift | 5 +++++ Sources/GRPC/ClientCalls/ServerStreamingCall.swift | 5 +++++ Sources/GRPC/ClientCalls/UnaryCall.swift | 5 +++++ 5 files changed, 23 insertions(+) diff --git a/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift b/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift index e210931f1..1361310c1 100644 --- a/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift +++ b/Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift @@ -37,6 +37,11 @@ public struct BidirectionalStreamingCall< return self.call.options } + /// The path used to make the RPC. + public var path: String { + return self.call.path + } + /// The `Channel` used to transport messages for this RPC. public var subchannel: EventLoopFuture { return self.call.channel diff --git a/Sources/GRPC/ClientCalls/ClientCall.swift b/Sources/GRPC/ClientCalls/ClientCall.swift index 0410fd1b7..de9c2360f 100644 --- a/Sources/GRPC/ClientCalls/ClientCall.swift +++ b/Sources/GRPC/ClientCalls/ClientCall.swift @@ -33,6 +33,9 @@ public protocol ClientCall { /// The options used to make the RPC. var options: CallOptions { get } + /// The path used to make the RPC. + var path: String { get } + /// HTTP/2 stream that requests and responses are sent and received on. var subchannel: EventLoopFuture { get } diff --git a/Sources/GRPC/ClientCalls/ClientStreamingCall.swift b/Sources/GRPC/ClientCalls/ClientStreamingCall.swift index 3df311535..00ca4c243 100644 --- a/Sources/GRPC/ClientCalls/ClientStreamingCall.swift +++ b/Sources/GRPC/ClientCalls/ClientStreamingCall.swift @@ -35,6 +35,11 @@ public struct ClientStreamingCall: StreamingReq return self.call.options } + /// The path used to make the RPC. + public var path: String { + return self.call.path + } + /// The `Channel` used to transport messages for this RPC. public var subchannel: EventLoopFuture { return self.call.channel diff --git a/Sources/GRPC/ClientCalls/ServerStreamingCall.swift b/Sources/GRPC/ClientCalls/ServerStreamingCall.swift index faf419aa7..67936f907 100644 --- a/Sources/GRPC/ClientCalls/ServerStreamingCall.swift +++ b/Sources/GRPC/ClientCalls/ServerStreamingCall.swift @@ -32,6 +32,11 @@ public struct ServerStreamingCall: ClientCall { return self.call.options } + /// The path used to make the RPC. + public var path: String { + return self.call.path + } + /// The `Channel` used to transport messages for this RPC. public var subchannel: EventLoopFuture { return self.call.channel diff --git a/Sources/GRPC/ClientCalls/UnaryCall.swift b/Sources/GRPC/ClientCalls/UnaryCall.swift index 335054aea..8033f3413 100644 --- a/Sources/GRPC/ClientCalls/UnaryCall.swift +++ b/Sources/GRPC/ClientCalls/UnaryCall.swift @@ -34,6 +34,11 @@ public struct UnaryCall: UnaryResponseClientCal return self.call.options } + /// The path used to make the RPC. + public var path: String { + return self.call.path + } + /// The `Channel` used to transport messages for this RPC. public var subchannel: EventLoopFuture { return self.call.channel From 8e8aa6bf5bed22353a15294d1babe3d66e27d1ad Mon Sep 17 00:00:00 2001 From: Ali Moazenzadeh Date: Thu, 12 Aug 2021 15:05:41 +0430 Subject: [PATCH 2/2] Remove path from ClientCall protocol --- Sources/GRPC/ClientCalls/ClientCall.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/Sources/GRPC/ClientCalls/ClientCall.swift b/Sources/GRPC/ClientCalls/ClientCall.swift index de9c2360f..0410fd1b7 100644 --- a/Sources/GRPC/ClientCalls/ClientCall.swift +++ b/Sources/GRPC/ClientCalls/ClientCall.swift @@ -33,9 +33,6 @@ public protocol ClientCall { /// The options used to make the RPC. var options: CallOptions { get } - /// The path used to make the RPC. - var path: String { get } - /// HTTP/2 stream that requests and responses are sent and received on. var subchannel: EventLoopFuture { get }