Make dispatcheQueue of responseHandler required

pull/16190/head
Muxi Yan 6 years ago
parent 21c32e8f01
commit 553664f59b
  1. 10
      src/objective-c/GRPCClient/GRPCCall.h

@ -150,14 +150,18 @@ extern id const kGRPCTrailersKey;
/** An object can implement this protocol to receive responses from server from a call. */ /** An object can implement this protocol to receive responses from server from a call. */
@protocol GRPCResponseHandler @protocol GRPCResponseHandler
@optional @optional
/** Issued when initial metadata is received from the server. */ /** Issued when initial metadata is received from the server. */
- (void)receivedInitialMetadata:(NSDictionary *)initialMetadata; - (void)receivedInitialMetadata:(NSDictionary *)initialMetadata;
/** /**
* Issued when a message is received from the server. The message may be raw data from the server * Issued when a message is received from the server. The message may be raw data from the server
* (when using \a GRPCCall2 directly) or deserialized proto object (when using \a ProtoRPC). * (when using \a GRPCCall2 directly) or deserialized proto object (when using \a ProtoRPC).
*/ */
- (void)receivedMessage:(id)message; - (void)receivedMessage:(id)message;
/** /**
* Issued when a call finished. If the call finished successfully, \a error is nil and \a * Issued when a call finished. If the call finished successfully, \a error is nil and \a
* trainingMetadata consists any trailing metadata received from the server. Otherwise, \a error * trainingMetadata consists any trailing metadata received from the server. Otherwise, \a error
@ -166,9 +170,13 @@ extern id const kGRPCTrailersKey;
*/ */
- (void)closedWithTrailingMetadata:(NSDictionary *)trailingMetadata error:(NSError *)error; - (void)closedWithTrailingMetadata:(NSDictionary *)trailingMetadata error:(NSError *)error;
@required
/** /**
* All the responses must be issued to a user-provided dispatch queue. This property specifies the * All the responses must be issued to a user-provided dispatch queue. This property specifies the
* dispatch queue to be used for issuing the notifications. * dispatch queue to be used for issuing the notifications. A serial queue should be provided if
* the order of responses (initial metadata, message, message, ..., message, trailing metadata)
* needs to be maintained.
*/ */
@property(atomic, readonly) dispatch_queue_t dispatchQueue; @property(atomic, readonly) dispatch_queue_t dispatchQueue;

Loading…
Cancel
Save