Skip to content

Remove deprecated API #2166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions Sources/GRPCCore/Call/Server/ServerContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Sources/GRPCCore/Documentation.docc/Development/Design.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 1 addition & 6 deletions Sources/GRPCCore/GRPCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 0 additions & 11 deletions Sources/GRPCCore/MethodDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading