forked from KyoheiG3/grpc-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient-call-bidistreaming.swift
24 lines (20 loc) · 1.21 KB
/
client-call-bidistreaming.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{{ access }} protocol {{ .|call:file,service,method }}: ClientCallBidirectionalStreaming {
/// Call this to wait for a result. Blocking.
func receive() throws -> {{ method|output }}
/// Call this to wait for a result. Nonblocking.
func receive(completion: @escaping ({{ method|output }}?, ClientError?) -> Void) throws
/// Call this to send each message in the request stream.
func send(_ message: {{ method|input }}, errorHandler: @escaping (Error) -> Void) throws
/// Call this to close the sending connection. Blocking.
func closeSend() throws
/// Call this to close the sending connection. Nonblocking.
func closeSend(completion: (() -> Void)?) throws
}
fileprivate final class {{ .|call:file,service,method }}Base: ClientCallBidirectionalStreamingBase<{{ method|input }}, {{ method|output }}>, {{ .|call:file,service,method }} {
override class var method: String { return "{{ .|path:file,service,method }}" }
}
//-{% if generateTestStubs %}
class {{ .|call:file,service,method }}TestStub: ClientCallBidirectionalStreamingTestStub<{{ method|input }}, {{ method|output }}>, {{ .|call:file,service,method }} {
override class var method: String { return "{{ .|path:file,service,method }}" }
}
//-{% endif %}