client-call-bidistreaming.swift 1.2 KB

123456789101112131415161718192021222324
  1. {{ access }} protocol {{ .|call:file,service,method }}: ClientCallBidirectionalStreaming {
  2. /// Call this to wait for a result. Blocking.
  3. func receive() throws -> {{ method|output }}
  4. /// Call this to wait for a result. Nonblocking.
  5. func receive(completion: @escaping ({{ method|output }}?, ClientError?) -> Void) throws
  6. /// Call this to send each message in the request stream.
  7. func send(_ message: {{ method|input }}, completion: @escaping (Error?) -> Void) throws
  8. /// Call this to close the sending connection. Blocking.
  9. func closeSend() throws
  10. /// Call this to close the sending connection. Nonblocking.
  11. func closeSend(completion: (() -> Void)?) throws
  12. }
  13. fileprivate final class {{ .|call:file,service,method }}Base: ClientCallBidirectionalStreamingBase<{{ method|input }}, {{ method|output }}>, {{ .|call:file,service,method }} {
  14. override class var method: String { return "{{ .|path:file,service,method }}" }
  15. }
  16. //-{% if generateTestStubs %}
  17. class {{ .|call:file,service,method }}TestStub: ClientCallBidirectionalStreamingTestStub<{{ method|input }}, {{ method|output }}>, {{ .|call:file,service,method }} {
  18. override class var method: String { return "{{ .|path:file,service,method }}" }
  19. }
  20. //-{% endif %}