Browse Source

Update a few comments.

Daniel Alm 7 years ago
parent
commit
bdfb1b80e3
2 changed files with 7 additions and 2 deletions
  1. 6 1
      Sources/SwiftGRPC/Core/Call.swift
  2. 1 1
      Sources/SwiftGRPC/Core/CompletionQueue.swift

+ 6 - 1
Sources/SwiftGRPC/Core/Call.swift

@@ -104,6 +104,7 @@ public class Call {
   /// - Parameter completion: a block to call with call results
   ///     The argument to `completion` will always have `.success = true`
   ///     because operations containing `.receiveCloseOnClient` always succeed.
+  ///   Runs synchronously on the completion queue's thread. Should not be blocking.
   /// - Throws: `CallError` if fails to call.
   public func start(_ style: CallStyle,
                     metadata: Metadata,
@@ -157,7 +158,8 @@ public class Call {
 
   /// Sends a message over a streaming connection.
   ///
-  /// Parameter data: the message data to send
+  /// - Parameter data: the message data to send
+  /// - Parameter completion: Runs synchronously on the completion queue's thread once the message has been sent. Should not be blocking.
   /// - Throws: `CallError` if fails to call. `CallWarning` if blocked.
   public func sendMessage(data: Data, completion: ((Error?) -> Void)? = nil) throws {
     try sendMutex.synchronize {
@@ -202,6 +204,7 @@ public class Call {
   }
 
   // Receive a message over a streaming connection.
+  /// - Parameter completion: Runs synchronously on the completion queue's thread once the message has been received. Should not be blocking.
   /// - Throws: `CallError` if fails to call.
   public func closeAndReceiveMessage(completion: @escaping (CallResult) -> Void) throws {
     try perform(OperationGroup(call: self, operations: [.sendCloseFromClient, .receiveMessage]) { operationGroup in
@@ -210,6 +213,7 @@ public class Call {
   }
 
   // Receive a message over a streaming connection.
+  /// - Parameter completion: Runs synchronously on the completion queue's thread once the message has been received. Should not be blocking.
   /// - Throws: `CallError` if fails to call.
   public func receiveMessage(completion: @escaping (CallResult) -> Void) throws {
     try perform(OperationGroup(call: self, operations: [.receiveMessage]) { operationGroup in
@@ -218,6 +222,7 @@ public class Call {
   }
 
   // Closes a streaming connection.
+  /// - Parameter completion: Runs synchronously on the completion queue's thread once the connection has been closed. Should not be blocking.
   /// - Throws: `CallError` if fails to call.
   public func close(completion: (() -> Void)? = nil) throws {
     try perform(OperationGroup(call: self, operations: [.sendCloseFromClient],

+ 1 - 1
Sources/SwiftGRPC/Core/CompletionQueue.swift

@@ -98,7 +98,7 @@ class CompletionQueue {
 
   /// Register an operation group for handling upon completion. Will throw if the queue has been shutdown already.
   ///
-  /// - Parameter operationGroup: the operation group to handle. Runs synchronously on the queue's thread, so should not be blocking.
+  /// - Parameter operationGroup: the operation group to handle.
   func register(_ operationGroup: OperationGroup, onSuccess: () throws -> Void) throws {
     try operationGroupsMutex.synchronize {
       guard !hasBeenShutdown