diff options
author | murgatroid99 <mlumish@google.com> | 2015-04-27 09:29:49 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2015-04-27 09:29:49 -0700 |
commit | 54e93d4b9a129bc44cd1c1c56ff51671a51d9671 (patch) | |
tree | 43bf7f1df05c3e03553f88c4ff25dad546f611d3 /src/objective-c/GRPCClient/private/GRPCWrappedCall.h | |
parent | a89cc64947ce0aec610cfefb2a2e7e95c75a0ec9 (diff) |
Made startBatch more strongly typed
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCWrappedCall.h')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCWrappedCall.h | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h index 405ea33979..d26638c08e 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h @@ -32,17 +32,62 @@ */ #import <Foundation/Foundation.h> +#include <grpc/grpc.h> #import "GRPCChannel.h" typedef void(^GRPCCompletionHandler)(NSDictionary *); +@protocol GRPCOp <NSObject> + +- (void)getOp:(grpc_op *)op; + +- (void(^)(void))opProcessor; + +@end + +@interface GRPCOpSendMetadata : NSObject <GRPCOp> + +- (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER; + +@end + +@interface GRPCOpSendMessage : NSObject <GRPCOp> + +- (instancetype)initWithMessage:(NSData *)message handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER; + +@end + +@interface GRPCOpSendClose : NSObject <GRPCOp> + +- (instancetype)initWithHandler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER; + +@end + +@interface GRPCOpRecvMetadata : NSObject <GRPCOp> + +- (instancetype)initWithHandler:(void(^)(NSDictionary *))handler NS_DESIGNATED_INITIALIZER; + +@end + +@interface GRPCOpRecvMessage : NSObject <GRPCOp> + +- (instancetype)initWithHandler:(void(^)(NSData *))handler NS_DESIGNATED_INITIALIZER; + +@end + +@interface GRPCOpRecvStatus : NSObject <GRPCOp> + +- (instancetype)initWithHandler:(void(^)(NSError *))handler NS_DESIGNATED_INITIALIZER; + +@end + @interface GRPCWrappedCall : NSObject - (instancetype)initWithChannel:(GRPCChannel *)channel method:(NSString *)method host:(NSString *)host NS_DESIGNATED_INITIALIZER; -- (void)startBatchWithOperations:(NSDictionary *)ops handleCompletion:(GRPCCompletionHandler)handleCompletion errorHandler:(void(^)())errorHandler; +- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)())errorHandler; -- (void)startBatchWithOperations:(NSDictionary *)ops handleCompletion:(GRPCCompletionHandler)handleCompletion; +- (void)startBatchWithOperations:(NSArray *)ops; - (void)cancel; @end |