Browse Source

Remove deprecated API (#2166)

Gus Cairo 1 year ago
parent
commit
e4da2bbb0d

+ 0 - 17
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 "<transport>:<address>" where
-  /// "<transport>" 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 "<transport>:<address>" where

+ 2 - 2
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
 

+ 1 - 6
Sources/GRPCCore/GRPCClient.swift

@@ -227,16 +227,11 @@ public final class GRPCClient<Transport: ClientTransport>: 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
   /// 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 {

+ 0 - 11
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 {