forked from KyoheiG3/grpc-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient-call-clientstreaming.swift
21 lines (18 loc) · 1.23 KB
/
client-call-clientstreaming.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{{ access }} protocol {{ .|call:file,service,method }}: ClientCallClientStreaming {
/// Call this to send each message in the request stream. Nonblocking.
func send(_ message: {{ method|input }}, errorHandler: @escaping (Error) -> Void) throws
/// Call this to close the connection and wait for a response. Blocking.
func closeAndReceive() throws -> {{ method|output }}
/// Call this to close the connection and wait for a response. Nonblocking.
func closeAndReceive(completion: @escaping ({{ method|output }}?, ClientError?) -> Void) throws
}
fileprivate final class {{ .|call:file,service,method }}Base: ClientCallClientStreamingBase<{{ method|input }}, {{ method|output }}>, {{ .|call:file,service,method }} {
override class var method: String { return "{{ .|path:file,service,method }}" }
}
//-{% if generateTestStubs %}
/// Simple fake implementation of {{ .|call:file,service,method }}
/// stores sent values for later verification and finall returns a previously-defined result.
class {{ .|call:file,service,method }}TestStub: ClientCallClientStreamingTestStub<{{ method|input }}, {{ method|output }}>, {{ .|call:file,service,method }} {
override class var method: String { return "{{ .|path:file,service,method }}" }
}
//-{% endif %}