aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCChannel.h
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-08-01 02:51:22 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-08-01 18:02:28 -0700
commitbd993df3f6eeaea7b032b272703c5fc41beeebef (patch)
tree9899a6c2911487bbba902228ff52765fa0cedf52 /src/objective-c/GRPCClient/private/GRPCChannel.h
parent3a5253eb129fa712f6962d0b8dc2b680b4e616c3 (diff)
Encapsulate grpc_call creation inside GRPCChannel
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannel.h')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.h b/src/objective-c/GRPCClient/private/GRPCChannel.h
index bc6a47d469..49f5bfcc18 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.h
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.h
@@ -33,19 +33,19 @@
#import <Foundation/Foundation.h>
-struct grpc_channel;
+#include <grpc/grpc.h>
-// Each separate instance of this class represents at least one TCP
-// connection to the provided host. To create a grpc_call, pass the
-// value of the unmanagedChannel property to grpc_channel_create_call.
-// Release this object when the call is finished.
+// Each separate instance of this class represents at least one TCP connection to the provided host.
+// To create a grpc_call to that host, use |unmanagedCallWithPath|. Release this object when the
+// call is finished.
@interface GRPCChannel : NSObject
-@property(nonatomic, readonly) struct grpc_channel *unmanagedChannel;
// Convenience constructor to allow for reuse of connections.
+ (instancetype)channelToHost:(NSString *)host;
- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel
+ hostName:(NSString *)hostName NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithChannel:(struct grpc_channel *)unmanagedChannel NS_DESIGNATED_INITIALIZER;
+- (grpc_call *)unmanagedCallWithPath:(NSString *)path;
@end