Skip to content

Commit bd779a3

Browse files
committed
Update hello-world tutorial
1 parent 9c76fa7 commit bd779a3

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Hello-World.tutorial

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
repository by running the following command in a terminal:
1919

2020
```console
21-
git clone https://github.com/grpc/grpc-swift
21+
git clone --branch 2.0.0-beta.1 https://github.com/grpc/grpc-swift
2222
```
2323

2424
You then need to change directory to the `Examples/hello-world` directory of the cloned
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
struct Greeter: Helloworld_GreeterServiceProtocol {
1+
struct Greeter: Helloworld_Greeter.SimpleServiceProtocol {
22
func sayHello(
3-
request: ServerRequest<Helloworld_HelloRequest>,
3+
request: Helloworld_HelloRequest,
44
context: ServerContext
5-
) async throws -> ServerResponse<Helloworld_HelloReply> {
5+
) async throws -> Helloworld_HelloReply {
66
var reply = Helloworld_HelloReply()
77
let recipient = request.message.name.isEmpty ? "stranger" : request.message.name
88
reply.message = "Hello, \(recipient)"
9-
return ServerResponse(message: reply)
9+
return reply
1010
}
1111
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
struct Greeter: Helloworld_GreeterServiceProtocol {
1+
struct Greeter: Helloworld_Greeter.SimpleServiceProtocol {
22
func sayHello(
3-
request: ServerRequest<Helloworld_HelloRequest>,
3+
request: Helloworld_HelloRequest,
44
context: ServerContext
5-
) async throws -> ServerResponse<Helloworld_HelloReply> {
5+
) async throws -> Helloworld_HelloReply {
66
var reply = Helloworld_HelloReply()
77
let recipient = request.message.name.isEmpty ? "stranger" : request.message.name
88
reply.message = "Hello, \(recipient)"
9-
return ServerResponse(message: reply)
9+
return reply
1010
}
1111

1212
func sayHelloAgain(
13-
request: ServerRequest<Helloworld_HelloRequest>,
13+
request: Helloworld_HelloRequest,
1414
context: ServerContext
15-
) async throws -> ServerResponse<Helloworld_HelloReply> {
15+
) async throws -> Helloworld_HelloReply {
1616
var reply = Helloworld_HelloReply()
1717
let recipient = request.message.name.isEmpty ? "stranger" : request.message.name
1818
reply.message = "Hello again, \(recipient)"
19-
return ServerResponse(message: reply)
19+
return reply
2020
}
2121
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
let greeter = Helloworld_GreeterClient(wrapping: client)
1+
let greeter = Helloworld_Greeter.Client(wrapping: client)
22
let reply = try await greeter.sayHello(.with { $0.name = self.name })
33
print(reply.message)

Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Resources/hello-world-sec04-step04.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let greeter = Helloworld_GreeterClient(wrapping: client)
1+
let greeter = Helloworld_Greeter.Client(wrapping: client)
22
let reply = try await greeter.sayHello(.with { $0.name = self.name })
33
print(reply.message)
44

0 commit comments

Comments
 (0)