Skip to content

Commit

Permalink
Send status on client for streaming calls
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianThiebaud committed Feb 27, 2018
1 parent 3602c87 commit 953b218
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Sources/gRPC/Call.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,26 +219,28 @@ public class Call {
}
operations = [
.sendInitialMetadata(metadata.copy()),
.sendMessage(ByteBuffer(data:message)),
.sendCloseFromClient,
.receiveInitialMetadata,
.receiveMessage,
.receiveStatusOnClient,
.sendMessage(ByteBuffer(data: message)),
.sendCloseFromClient,
.receiveMessage
]
case .serverStreaming:
guard let message = message else {
throw CallError.invalidMessage
}
operations = [
.sendInitialMetadata(metadata.copy()),
.sendMessage(ByteBuffer(data:message)),
.sendCloseFromClient,
.receiveInitialMetadata,
.sendMessage(ByteBuffer(data: message)),
.sendCloseFromClient
.receiveStatusOnClient,
]
case .clientStreaming, .bidiStreaming:
operations = [
.sendInitialMetadata(metadata.copy()),
.receiveInitialMetadata
.receiveInitialMetadata,
.receiveStatusOnClient,
]
}
try perform(OperationGroup(call: self,
Expand Down

0 comments on commit 953b218

Please sign in to comment.