GRPC Objective-C  1.39.1
GRPCChannelPool.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
21 NS_ASSUME_NONNULL_BEGIN
22 
23 @protocol GRPCChannel;
24 @class GRPCChannel;
25 @class GRPCChannelPool;
26 @class GRPCCompletionQueue;
28 @class GRPCWrappedCall;
29 
36 @interface GRPCPooledChannel : NSObject
37 
38 - (nullable instancetype)init NS_UNAVAILABLE;
39 
40 + (nullable instancetype)new NS_UNAVAILABLE;
41 
45 - (nullable instancetype)initWithChannelConfiguration:
46  (GRPCChannelConfiguration *)channelConfiguration;
47 
52 - (nullable GRPCWrappedCall *)wrappedCallWithPath:(NSString *)path
53  completionQueue:(GRPCCompletionQueue *)queue
54  callOptions:(GRPCCallOptions *)callOptions;
55 
60 - (void)notifyWrappedCallDealloc:(GRPCWrappedCall *)wrappedCall;
61 
67 - (void)disconnect;
68 
69 @end
70 
75 @interface GRPCChannelPool : NSObject
76 
77 - (nullable instancetype)init NS_UNAVAILABLE;
78 
79 + (nullable instancetype)new NS_UNAVAILABLE;
80 
84 + (nullable instancetype)sharedInstance;
85 
89 - (nullable GRPCPooledChannel *)channelWithHost:(NSString *)host
90  callOptions:(GRPCCallOptions *)callOptions;
91 
95 - (void)disconnectAllChannels;
96 
97 @end
98 
99 NS_ASSUME_NONNULL_END
Immutable user configurable options for a gRPC call.
Definition: GRPCCallOptions.h:30
Signature for the channel.
Definition: GRPCChannel.h:36
Each separate instance of this class represents at least one TCP connection to the provided host.
Definition: GRPCChannel.h:66
Manage the pool of connected channels.
Definition: GRPCChannelPool.h:76
nullable instancetype sharedInstance()
Get the global channel pool.
nullable instancetype NS_UNAVAILABLE()
void disconnectAllChannels()
Disconnect all channels in this pool.
This class lets one more easily use |grpc_completion_queue|.
Definition: GRPCCompletionQueue.h:36
A proxied channel object that can be retained and used to create GRPCWrappedCall object regardless of...
Definition: GRPCChannelPool.h:37
nullable instancetype NS_UNAVAILABLE()
void disconnect()
Force the channel to disconnect immediately.
Definition: GRPCWrappedCall.h:77