|
|
@@ -49,21 +49,21 @@
|
|
|
/// Asynchronous. Server-streaming.
|
|
|
/// Send the initial message.
|
|
|
/// Use methods on the returned object to get streamed responses.
|
|
|
- func {{ method|methodDescriptorName|lowercase }}(_ request: {{ method|input }}, completion: @escaping (CallResult)->())
|
|
|
+ func {{ method|methodDescriptorName|lowercase }}(_ request: {{ method|input }}, completion: ((CallResult)->())?)
|
|
|
throws -> {{ .|call:file,service,method }}
|
|
|
//-{% endif %}
|
|
|
//-{% if method|methodIsClientStreaming %}
|
|
|
/// Asynchronous. Client-streaming.
|
|
|
/// Use methods on the returned object to stream messages and
|
|
|
/// to close the connection and wait for a final response.
|
|
|
- func {{ method|methodDescriptorName|lowercase }}(completion: @escaping (CallResult)->())
|
|
|
+ func {{ method|methodDescriptorName|lowercase }}(completion: ((CallResult)->())?)
|
|
|
throws -> {{ .|call:file,service,method }}
|
|
|
//-{% endif %}
|
|
|
//-{% if method|methodIsBidiStreaming %}
|
|
|
/// Asynchronous. Bidirectional-streaming.
|
|
|
/// Use methods on the returned object to stream messages,
|
|
|
/// to wait for replies, and to close the connection.
|
|
|
- func {{ method|methodDescriptorName|lowercase }}(completion: @escaping (CallResult)->())
|
|
|
+ func {{ method|methodDescriptorName|lowercase }}(completion: ((CallResult)->())?)
|
|
|
throws -> {{ .|call:file,service,method }}
|
|
|
//-{% endif %}
|
|
|
|
|
|
@@ -186,7 +186,7 @@ class {{ .|serviceclass:file,service }}TestStub: {{ .|serviceclass:file,service
|
|
|
//-{% if method|methodIsServerStreaming %}
|
|
|
var {{ method|methodDescriptorName|lowercase }}Requests: [{{ method|input }}] = []
|
|
|
var {{ method|methodDescriptorName|lowercase }}Calls: [{{ .|call:file,service,method }}] = []
|
|
|
- func {{ method|methodDescriptorName|lowercase }}(_ request: {{ method|input }}, completion: @escaping (CallResult)->())
|
|
|
+ func {{ method|methodDescriptorName|lowercase }}(_ request: {{ method|input }}, completion: ((CallResult)->())?)
|
|
|
throws -> {{ .|call:file,service,method }} {
|
|
|
{{ method|methodDescriptorName|lowercase }}Requests.append(request)
|
|
|
defer { {{ method|methodDescriptorName|lowercase }}Calls.removeFirst() }
|
|
|
@@ -195,7 +195,7 @@ class {{ .|serviceclass:file,service }}TestStub: {{ .|serviceclass:file,service
|
|
|
//-{% endif %}
|
|
|
//-{% if method|methodIsClientStreaming %}
|
|
|
var {{ method|methodDescriptorName|lowercase }}Calls: [{{ .|call:file,service,method }}] = []
|
|
|
- func {{ method|methodDescriptorName|lowercase }}(completion: @escaping (CallResult)->())
|
|
|
+ func {{ method|methodDescriptorName|lowercase }}(completion: ((CallResult)->())?)
|
|
|
throws -> {{ .|call:file,service,method }} {
|
|
|
defer { {{ method|methodDescriptorName|lowercase }}Calls.removeFirst() }
|
|
|
return {{ method|methodDescriptorName|lowercase }}Calls.first!
|
|
|
@@ -203,7 +203,7 @@ class {{ .|serviceclass:file,service }}TestStub: {{ .|serviceclass:file,service
|
|
|
//-{% endif %}
|
|
|
//-{% if method|methodIsBidiStreaming %}
|
|
|
var {{ method|methodDescriptorName|lowercase }}Calls: [{{ .|call:file,service,method }}] = []
|
|
|
- func {{ method|methodDescriptorName|lowercase }}(completion: @escaping (CallResult)->())
|
|
|
+ func {{ method|methodDescriptorName|lowercase }}(completion: ((CallResult)->())?)
|
|
|
throws -> {{ .|call:file,service,method }} {
|
|
|
defer { {{ method|methodDescriptorName|lowercase }}Calls.removeFirst() }
|
|
|
return {{ method|methodDescriptorName|lowercase }}Calls.first!
|