Skip to content

Commit b5aa1d9

Browse files
committed
Update comments in client templates.
1 parent 258478f commit b5aa1d9

File tree

7 files changed

+53
-45
lines changed

7 files changed

+53
-45
lines changed

Examples/Echo/Generated/echo.client.pb.swift

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public enum Echo_EchoClientError : Error {
4949
case invalidMessageReceived
5050
case error(c: CallResult)
5151
}
52-
// Get (Unary)
52+
/// Get (Unary)
5353
public class Echo_EchoGetCall {
5454
private var call : Call
5555

@@ -84,7 +84,7 @@ public class Echo_EchoGetCall {
8484
}
8585
}
8686

87-
// Expand (Server Streaming)
87+
/// Expand (Server Streaming)
8888
public class Echo_EchoExpandCall {
8989
private var call : Call
9090

@@ -93,7 +93,7 @@ public class Echo_EchoExpandCall {
9393
self.call = channel.makeCall("/echo.Echo/Expand")
9494
}
9595

96-
// Call this once with the message to send.
96+
/// Call this once with the message to send.
9797
fileprivate func run(request: Echo_EchoRequest, metadata: Metadata) throws -> Echo_EchoExpandCall {
9898
let requestData = try request.serializeProtobuf()
9999
let sem = DispatchSemaphore(value: 0)
@@ -107,7 +107,7 @@ public class Echo_EchoExpandCall {
107107
return self
108108
}
109109

110-
// Call this to wait for a result. Blocks.
110+
/// Call this to wait for a result. Blocks.
111111
public func receive() throws -> Echo_EchoResponse {
112112
var returnError : Echo_EchoClientError?
113113
var response : Echo_EchoResponse!
@@ -133,7 +133,7 @@ public class Echo_EchoExpandCall {
133133
}
134134
}
135135

136-
// Collect (Client Streaming)
136+
/// Collect (Client Streaming)
137137
public class Echo_EchoCollectCall {
138138
private var call : Call
139139

@@ -142,7 +142,7 @@ public class Echo_EchoCollectCall {
142142
self.call = channel.makeCall("/echo.Echo/Collect")
143143
}
144144

145-
// Call this to start a call.
145+
/// Call this to start a call.
146146
fileprivate func run(metadata:Metadata) throws -> Echo_EchoCollectCall {
147147
let sem = DispatchSemaphore(value: 0)
148148
try self.call.start(.clientStreaming,
@@ -154,13 +154,13 @@ public class Echo_EchoCollectCall {
154154
return self
155155
}
156156

157-
// Call this to send each message in the request stream.
157+
/// Call this to send each message in the request stream.
158158
public func send(_ message: Echo_EchoRequest) throws {
159159
let messageData = try message.serializeProtobuf()
160160
try call.sendMessage(data:messageData)
161161
}
162162

163-
// Call this to close the connection and wait for a response. Blocks.
163+
/// Call this to close the connection and wait for a response. Blocks.
164164
public func closeAndReceive() throws -> Echo_EchoResponse {
165165
var returnError : Echo_EchoClientError?
166166
var returnResponse : Echo_EchoResponse!
@@ -187,7 +187,7 @@ public class Echo_EchoCollectCall {
187187
}
188188
}
189189

190-
// Update (Bidirectional Streaming)
190+
/// Update (Bidirectional Streaming)
191191
public class Echo_EchoUpdateCall {
192192
private var call : Call
193193

@@ -196,6 +196,7 @@ public class Echo_EchoUpdateCall {
196196
self.call = channel.makeCall("/echo.Echo/Update")
197197
}
198198

199+
/// Call this to start a call.
199200
fileprivate func run(metadata:Metadata) throws -> Echo_EchoUpdateCall {
200201
let sem = DispatchSemaphore(value: 0)
201202
try self.call.start(.bidiStreaming,
@@ -207,6 +208,7 @@ public class Echo_EchoUpdateCall {
207208
return self
208209
}
209210

211+
/// Call this to wait for a result. Blocks.
210212
public func receive() throws -> Echo_EchoResponse {
211213
var returnError : Echo_EchoClientError?
212214
var returnMessage : Echo_EchoResponse!
@@ -231,11 +233,13 @@ public class Echo_EchoUpdateCall {
231233
return returnMessage
232234
}
233235

236+
/// Call this to send each message in the request stream.
234237
public func send(_ message:Echo_EchoRequest) throws {
235238
let messageData = try message.serializeProtobuf()
236239
try call.sendMessage(data:messageData)
237240
}
238241

242+
/// Call this to close the sending connection.
239243
public func closeSend() throws {
240244
let sem = DispatchSemaphore(value: 0)
241245
try call.close() {
@@ -246,7 +250,7 @@ public class Echo_EchoUpdateCall {
246250
}
247251

248252

249-
// Call methods of this class to make API calls.
253+
/// Call methods of this class to make API calls.
250254
public class Echo_EchoService {
251255
private var channel: Channel
252256

@@ -279,25 +283,25 @@ public class Echo_EchoService {
279283
metadata = Metadata()
280284
}
281285

282-
// Synchronous. Unary.
286+
/// Synchronous. Unary.
283287
public func get(_ request: Echo_EchoRequest) throws -> Echo_EchoResponse {
284288
return try Echo_EchoGetCall(channel).run(request:request, metadata:metadata)
285289
}
286-
// Asynchronous. Server-streaming.
287-
// Send the initial message.
288-
// Use methods on the returned object to get streamed responses.
290+
/// Asynchronous. Server-streaming.
291+
/// Send the initial message.
292+
/// Use methods on the returned object to get streamed responses.
289293
public func expand(_ request: Echo_EchoRequest) throws -> Echo_EchoExpandCall {
290294
return try Echo_EchoExpandCall(channel).run(request:request, metadata:metadata)
291295
}
292-
// Asynchronous. Client-streaming.
293-
// Use methods on the returned object to stream messages and
294-
// to close the connection and wait for a final response.
296+
/// Asynchronous. Client-streaming.
297+
/// Use methods on the returned object to stream messages and
298+
/// to close the connection and wait for a final response.
295299
public func collect() throws -> Echo_EchoCollectCall {
296300
return try Echo_EchoCollectCall(channel).run(metadata:metadata)
297301
}
298-
// Asynchronous. Bidirectional-streaming.
299-
// Use methods on the returned object to stream messages,
300-
// to wait for replies, and to close the connection.
302+
/// Asynchronous. Bidirectional-streaming.
303+
/// Use methods on the returned object to stream messages,
304+
/// to wait for replies, and to close the connection.
301305
public func update() throws -> Echo_EchoUpdateCall {
302306
return try Echo_EchoUpdateCall(channel).run(metadata:metadata)
303307
}

0 commit comments

Comments
 (0)