From ddcc13af63f8d8ef09f737c0d36578e16ea7c9a4 Mon Sep 17 00:00:00 2001 From: Gus Cairo Date: Fri, 17 Jan 2025 17:05:53 +0000 Subject: [PATCH 1/2] Remove deprecated API --- .../GRPCCore/Call/Server/ServerContext.swift | 17 ----------------- Sources/GRPCCore/GRPCClient.swift | 5 ----- Sources/GRPCCore/MethodDescriptor.swift | 11 ----------- 3 files changed, 33 deletions(-) diff --git a/Sources/GRPCCore/Call/Server/ServerContext.swift b/Sources/GRPCCore/Call/Server/ServerContext.swift index 812a22886..d2518adf9 100644 --- a/Sources/GRPCCore/Call/Server/ServerContext.swift +++ b/Sources/GRPCCore/Call/Server/ServerContext.swift @@ -19,23 +19,6 @@ public struct ServerContext: Sendable { /// A description of the method being called. public var descriptor: MethodDescriptor - /// A description of the remote peer. - /// - /// The format of the description should follow the pattern ":
" where - /// "" indicates the underlying network transport (such as "ipv4", "unix", or - /// "in-process"). This is a guideline for how descriptions should be formatted; different - /// implementations may not follow this format so you shouldn't make assumptions based on it. - /// - /// Some examples include: - /// - "ipv4:127.0.0.1:31415", - /// - "ipv6:[::1]:443", - /// - "in-process:27182". - @available(*, deprecated, renamed: "remotePeer") - public var peer: String { - get { remotePeer } - set { remotePeer = newValue } - } - /// A description of the remote peer. /// /// The format of the description should follow the pattern ":
" where diff --git a/Sources/GRPCCore/GRPCClient.swift b/Sources/GRPCCore/GRPCClient.swift index b1e4ed65e..7d01fa02c 100644 --- a/Sources/GRPCCore/GRPCClient.swift +++ b/Sources/GRPCCore/GRPCClient.swift @@ -227,11 +227,6 @@ public final class GRPCClient: Sendable { } } - @available(*, deprecated, renamed: "runConnections", message: "It'll be removed before v2.") - public func run() async throws { - try await self.runConnections() - } - /// Close the client. /// /// The transport will be closed: this means that it will be given enough time to wait for diff --git a/Sources/GRPCCore/MethodDescriptor.swift b/Sources/GRPCCore/MethodDescriptor.swift index 3cfc500c1..20a1f3f50 100644 --- a/Sources/GRPCCore/MethodDescriptor.swift +++ b/Sources/GRPCCore/MethodDescriptor.swift @@ -51,17 +51,6 @@ public struct MethodDescriptor: Sendable, Hashable { self.service = ServiceDescriptor(fullyQualifiedService: fullyQualifiedService) self.method = method } - - @available(*, deprecated, renamed: "init(fullyQualifiedService:method:)") - /// Creates a new method descriptor. - /// - /// - Parameters: - /// - service: The fully qualified name of the service, including the package - /// name. For example, "helloworld.Greeter". - /// - method: The name of the method. For example, "SayHello". - public init(service: String, method: String) { - self.init(fullyQualifiedService: service, method: method) - } } extension MethodDescriptor: CustomStringConvertible { From babdde1917ce213e8008c937efb4d8b10635cf2c Mon Sep 17 00:00:00 2001 From: Gus Cairo Date: Fri, 17 Jan 2025 17:19:26 +0000 Subject: [PATCH 2/2] Fix docs --- Sources/GRPCCore/Documentation.docc/Development/Design.md | 4 ++-- Sources/GRPCCore/GRPCClient.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/GRPCCore/Documentation.docc/Development/Design.md b/Sources/GRPCCore/Documentation.docc/Development/Design.md index cecccbafa..8175f036f 100644 --- a/Sources/GRPCCore/Documentation.docc/Development/Design.md +++ b/Sources/GRPCCore/Documentation.docc/Development/Design.md @@ -173,12 +173,12 @@ concurrency. Most users won't use ``GRPCClient`` to execute RPCs directly, instead they will use the generated client stubs which wrap the ``GRPCClient``. Users are responsible for creating the client and running it (which starts and runs the -underlying transport). This is done by calling ``GRPCClient/run()``. The client +underlying transport). This is done by calling ``GRPCClient/runConnections()``. The client can be shutdown gracefully by calling ``GRPCClient/beginGracefulShutdown()`` which will stop new RPCs from starting (by failing them with ``RPCError/Code-swift.struct/unavailable``) but allow existing ones to continue. Existing work can be stopped more abruptly by cancelling the task where -``GRPCClient/run()`` is executing. +``GRPCClient/runConnections()`` is executing. #### Server diff --git a/Sources/GRPCCore/GRPCClient.swift b/Sources/GRPCCore/GRPCClient.swift index 7d01fa02c..b3093f8b1 100644 --- a/Sources/GRPCCore/GRPCClient.swift +++ b/Sources/GRPCCore/GRPCClient.swift @@ -231,7 +231,7 @@ public final class GRPCClient: Sendable { /// /// The transport will be closed: this means that it will be given enough time to wait for /// in-flight RPCs to finish executing, but no new RPCs will be accepted. You can cancel the task - /// executing ``run()`` if you want to abruptly stop in-flight RPCs. + /// executing ``runConnections()`` if you want to abruptly stop in-flight RPCs. public func beginGracefulShutdown() { let wasRunning = self.stateMachine.withLock { $0.state.beginGracefulShutdown() } if wasRunning {