Skip to content

Commit

Permalink
Add sync method variant for finishing RequestStreamWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
schwmi committed Oct 14, 2022
1 parent cfa950f commit f91f6d3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public struct GRPCAsyncRequestStreamWriter<Request: Sendable>: Sendable {
self.asyncWriter.finish()
}

/// Sync variant for finishing the request stream for the RPC. This must be called when there are no more requests to be sent.
public func finish() {
self.asyncWriter.finish()
}

/// Finish the request stream for the RPC with the given error.
internal func finish(_ error: Error) {
self.asyncWriter.finish(error: error)
Expand Down

0 comments on commit f91f6d3

Please sign in to comment.