Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | * Copyright 2015-2016 gRPC authors. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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 |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 16 | * |
| 17 | */ |
| 18 | |
Nicolas "Pixel" Noble | 1ff52d5 | 2015-03-01 05:24:36 +0100 | [diff] [blame] | 19 | #ifndef GRPC_GRPC_H |
| 20 | #define GRPC_GRPC_H |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 21 | |
| 22 | #include <grpc/status.h> |
| 23 | |
David Garcia Quintas | 25d02d5 | 2015-06-04 17:40:54 -0700 | [diff] [blame] | 24 | #include <grpc/byte_buffer.h> |
Craig Tiller | f40df23 | 2016-03-25 13:38:14 -0700 | [diff] [blame] | 25 | #include <grpc/impl/codegen/connectivity_state.h> |
| 26 | #include <grpc/impl/codegen/grpc_types.h> |
| 27 | #include <grpc/impl/codegen/propagation_bits.h> |
Craig Tiller | b37d53e | 2016-10-26 16:16:35 -0700 | [diff] [blame] | 28 | #include <grpc/slice.h> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 29 | #include <grpc/support/time.h> |
Craig Tiller | f40df23 | 2016-03-25 13:38:14 -0700 | [diff] [blame] | 30 | #include <stddef.h> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 31 | |
| 32 | #ifdef __cplusplus |
| 33 | extern "C" { |
| 34 | #endif |
| 35 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 36 | /*! \mainpage GRPC Core |
| 37 | * |
Craig Tiller | d6599a3 | 2015-09-03 09:37:02 -0700 | [diff] [blame] | 38 | * The GRPC Core library is a low-level library designed to be wrapped by higher |
| 39 | * level libraries. The top-level API is provided in grpc.h. Security related |
| 40 | * functionality lives in grpc_security.h. |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 41 | */ |
| 42 | |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 43 | GRPCAPI void grpc_metadata_array_init(grpc_metadata_array *array); |
| 44 | GRPCAPI void grpc_metadata_array_destroy(grpc_metadata_array *array); |
Craig Tiller | ea61b07 | 2015-02-03 19:19:27 -0800 | [diff] [blame] | 45 | |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 46 | GRPCAPI void grpc_call_details_init(grpc_call_details *details); |
| 47 | GRPCAPI void grpc_call_details_destroy(grpc_call_details *details); |
Craig Tiller | ea61b07 | 2015-02-03 19:19:27 -0800 | [diff] [blame] | 48 | |
Hongwei Wang | 85ad685 | 2015-08-13 16:13:10 -0700 | [diff] [blame] | 49 | /** Registers a plugin to be initialized and destroyed with the library. |
Hongwei Wang | a83d1b3 | 2015-08-06 12:52:18 -0700 | [diff] [blame] | 50 | |
Craig Tiller | d6c98df | 2015-08-18 09:33:44 -0700 | [diff] [blame] | 51 | The \a init and \a destroy functions will be invoked as part of |
| 52 | \a grpc_init() and \a grpc_shutdown(), respectively. |
Hongwei Wang | 85ad685 | 2015-08-13 16:13:10 -0700 | [diff] [blame] | 53 | Note that these functions can be invoked an arbitrary number of times |
| 54 | (and hence so will \a init and \a destroy). |
Craig Tiller | d6c98df | 2015-08-18 09:33:44 -0700 | [diff] [blame] | 55 | It is safe to pass NULL to either argument. Plugins are destroyed in |
Hongwei Wang | 85ad685 | 2015-08-13 16:13:10 -0700 | [diff] [blame] | 56 | the reverse order they were initialized. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 57 | GRPCAPI void grpc_register_plugin(void (*init)(void), void (*destroy)(void)); |
Hongwei Wang | a3780a8 | 2015-07-17 15:27:18 -0700 | [diff] [blame] | 58 | |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 59 | /** Initialize the grpc library. |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 60 | |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 61 | It is not safe to call any other grpc functions before calling this. |
| 62 | (To avoid overhead, little checking is done, and some things may work. We |
| 63 | do not warrant that they will continue to do so in future revisions of this |
| 64 | library). */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 65 | GRPCAPI void grpc_init(void); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 66 | |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 67 | /** Shut down the grpc library. |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 68 | |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 69 | No memory is used by grpc after this call returns, nor are any instructions |
| 70 | executing within the grpc library. |
| 71 | Prior to calling, all application owned grpc objects must have been |
| 72 | destroyed. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 73 | GRPCAPI void grpc_shutdown(void); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 74 | |
Craig Tiller | 2e622bc | 2015-07-10 07:46:03 -0700 | [diff] [blame] | 75 | /** Return a string representing the current version of grpc */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 76 | GRPCAPI const char *grpc_version_string(void); |
Craig Tiller | 2e622bc | 2015-07-10 07:46:03 -0700 | [diff] [blame] | 77 | |
Craig Tiller | 8dfdb7e | 2016-08-29 11:25:56 -0700 | [diff] [blame] | 78 | /** Return a string specifying what the 'g' in gRPC stands for */ |
| 79 | GRPCAPI const char *grpc_g_stands_for(void); |
| 80 | |
Sree Kuchibhotla | bf18428 | 2017-03-21 15:18:58 -0700 | [diff] [blame] | 81 | /** Returns the completion queue factory based on the attributes. MAY return a |
| 82 | NULL if no factory can be found */ |
| 83 | GRPCAPI const grpc_completion_queue_factory * |
| 84 | grpc_completion_queue_factory_lookup( |
| 85 | const grpc_completion_queue_attributes *attributes); |
| 86 | |
| 87 | /** Helper function to create a completion queue with grpc_cq_completion_type |
| 88 | of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING */ |
| 89 | GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_next( |
| 90 | void *reserved); |
| 91 | |
| 92 | /** Helper function to create a completion queue with grpc_cq_completion_type |
| 93 | of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING */ |
| 94 | GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_pluck( |
| 95 | void *reserved); |
| 96 | |
Sree Kuchibhotla | 7a4e5b4 | 2017-02-17 09:28:46 -0800 | [diff] [blame] | 97 | /** Create a completion queue */ |
Sree Kuchibhotla | 321881d | 2017-02-27 11:25:28 -0800 | [diff] [blame] | 98 | GRPCAPI grpc_completion_queue *grpc_completion_queue_create( |
Sree Kuchibhotla | 2abbf8a | 2017-03-21 17:31:03 -0700 | [diff] [blame] | 99 | const grpc_completion_queue_factory *factory, |
| 100 | const grpc_completion_queue_attributes *attributes, void *reserved); |
Sree Kuchibhotla | 7a4e5b4 | 2017-02-17 09:28:46 -0800 | [diff] [blame] | 101 | |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 102 | /** Blocks until an event is available, the completion queue is being shut down, |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 103 | or deadline is reached. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 104 | |
vjpai | 1854d77 | 2015-06-08 01:12:29 -0700 | [diff] [blame] | 105 | Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout, |
| 106 | otherwise a grpc_event describing the event that occurred. |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 107 | |
| 108 | Callers must not call grpc_completion_queue_next and |
| 109 | grpc_completion_queue_pluck simultaneously on the same completion queue. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 110 | GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, |
| 111 | gpr_timespec deadline, |
| 112 | void *reserved); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 113 | |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 114 | /** Blocks until an event with tag 'tag' is available, the completion queue is |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 115 | being shutdown or deadline is reached. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 116 | |
vjpai | 1854d77 | 2015-06-08 01:12:29 -0700 | [diff] [blame] | 117 | Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout, |
| 118 | otherwise a grpc_event describing the event that occurred. |
Craig Tiller | e793ba1 | 2015-05-18 09:37:22 -0700 | [diff] [blame] | 119 | |
| 120 | Callers must not call grpc_completion_queue_next and |
Hongwei Wang | 85ad685 | 2015-08-13 16:13:10 -0700 | [diff] [blame] | 121 | grpc_completion_queue_pluck simultaneously on the same completion queue. |
| 122 | |
Craig Tiller | 489df07 | 2015-08-01 16:15:45 -0700 | [diff] [blame] | 123 | Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS |
| 124 | concurrently executing plucks at any time. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 125 | GRPCAPI grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, |
| 126 | void *tag, gpr_timespec deadline, |
| 127 | void *reserved); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 128 | |
Craig Tiller | 489df07 | 2015-08-01 16:15:45 -0700 | [diff] [blame] | 129 | /** Maximum number of outstanding grpc_completion_queue_pluck executions per |
| 130 | completion queue */ |
| 131 | #define GRPC_MAX_COMPLETION_QUEUE_PLUCKERS 6 |
| 132 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 133 | /** Begin destruction of a completion queue. Once all possible events are |
| 134 | drained then grpc_completion_queue_next will start to produce |
| 135 | GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call |
| 136 | grpc_completion_queue_destroy. |
Craig Tiller | b20111c | 2015-04-10 23:27:11 +0000 | [diff] [blame] | 137 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 138 | After calling this function applications should ensure that no |
| 139 | NEW work is added to be published on this completion queue. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 140 | GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 141 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 142 | /** Destroy a completion queue. The caller must ensure that the queue is |
| 143 | drained and no threads are executing grpc_completion_queue_next */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 144 | GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 145 | |
Vijay Pai | 58c33ba | 2017-09-01 14:08:42 -0700 | [diff] [blame] | 146 | /** Create a completion queue alarm instance */ |
| 147 | GRPCAPI grpc_alarm *grpc_alarm_create(void *reserved); |
| 148 | |
| 149 | /** Set a completion queue alarm instance associated to \a cq. |
David Garcia Quintas | f747bbc | 2015-10-04 23:09:47 -0700 | [diff] [blame] | 150 | * |
David Garcia Quintas | 7fd0fd5 | 2015-10-07 17:41:08 -0700 | [diff] [blame] | 151 | * Once the alarm expires (at \a deadline) or it's cancelled (see \a |
| 152 | * grpc_alarm_cancel), an event with tag \a tag will be added to \a cq. If the |
| 153 | * alarm expired, the event's success bit will be true, false otherwise (ie, |
| 154 | * upon cancellation). */ |
Vijay Pai | 58c33ba | 2017-09-01 14:08:42 -0700 | [diff] [blame] | 155 | GRPCAPI void grpc_alarm_set(grpc_alarm *alarm, grpc_completion_queue *cq, |
| 156 | gpr_timespec deadline, void *tag, void *reserved); |
David Garcia Quintas | f747bbc | 2015-10-04 23:09:47 -0700 | [diff] [blame] | 157 | |
David Garcia Quintas | 7fd0fd5 | 2015-10-07 17:41:08 -0700 | [diff] [blame] | 158 | /** Cancel a completion queue alarm. Calling this function over an alarm that |
| 159 | * has already fired has no effect. */ |
Vijay Pai | 58c33ba | 2017-09-01 14:08:42 -0700 | [diff] [blame] | 160 | GRPCAPI void grpc_alarm_cancel(grpc_alarm *alarm, void *reserved); |
David Garcia Quintas | f747bbc | 2015-10-04 23:09:47 -0700 | [diff] [blame] | 161 | |
| 162 | /** Destroy the given completion queue alarm, cancelling it in the process. */ |
Vijay Pai | 58c33ba | 2017-09-01 14:08:42 -0700 | [diff] [blame] | 163 | GRPCAPI void grpc_alarm_destroy(grpc_alarm *alarm, void *reserved); |
David Garcia Quintas | f747bbc | 2015-10-04 23:09:47 -0700 | [diff] [blame] | 164 | |
Craig Tiller | 48cb07c | 2015-07-15 16:16:15 -0700 | [diff] [blame] | 165 | /** Check the connectivity state of a channel. */ |
Craig Tiller | f40df23 | 2016-03-25 13:38:14 -0700 | [diff] [blame] | 166 | GRPCAPI grpc_connectivity_state grpc_channel_check_connectivity_state( |
| 167 | grpc_channel *channel, int try_to_connect); |
Craig Tiller | 48cb07c | 2015-07-15 16:16:15 -0700 | [diff] [blame] | 168 | |
Alexander Polcyn | c3b1f18 | 2017-04-18 13:51:36 -0700 | [diff] [blame] | 169 | /** Number of active "external connectivity state watchers" attached to a |
| 170 | * channel. |
| 171 | * Useful for testing. **/ |
| 172 | GRPCAPI int grpc_channel_num_external_connectivity_watchers( |
| 173 | grpc_channel *channel); |
| 174 | |
Craig Tiller | 48cb07c | 2015-07-15 16:16:15 -0700 | [diff] [blame] | 175 | /** Watch for a change in connectivity state. |
| 176 | Once the channel connectivity state is different from last_observed_state, |
| 177 | tag will be enqueued on cq with success=1. |
| 178 | If deadline expires BEFORE the state is changed, tag will be enqueued on cq |
Craig Tiller | 2cd9dd9 | 2015-07-31 16:34:37 -0700 | [diff] [blame] | 179 | with success=0. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 180 | GRPCAPI void grpc_channel_watch_connectivity_state( |
Craig Tiller | 48cb07c | 2015-07-15 16:16:15 -0700 | [diff] [blame] | 181 | grpc_channel *channel, grpc_connectivity_state last_observed_state, |
Craig Tiller | 2cd9dd9 | 2015-07-31 16:34:37 -0700 | [diff] [blame] | 182 | gpr_timespec deadline, grpc_completion_queue *cq, void *tag); |
Craig Tiller | 48cb07c | 2015-07-15 16:16:15 -0700 | [diff] [blame] | 183 | |
Yuchen Zeng | a2e506e | 2017-08-22 16:45:44 -0700 | [diff] [blame] | 184 | /** Check whether a grpc channel supports connectivity watcher */ |
Yuchen Zeng | 6a6d618 | 2017-08-22 13:43:38 -0700 | [diff] [blame] | 185 | GRPCAPI int grpc_channel_support_connectivity_watcher(grpc_channel *channel); |
| 186 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 187 | /** Create a call given a grpc_channel, in order to call 'method'. All |
| 188 | completions are sent to 'completion_queue'. 'method' and 'host' need only |
Craig Tiller | 5847177 | 2015-07-31 17:12:34 -0700 | [diff] [blame] | 189 | live through the invocation of this function. |
| 190 | If parent_call is non-NULL, it must be a server-side call. It will be used |
David Garcia Quintas | 15eba13 | 2016-08-09 15:20:48 -0700 | [diff] [blame] | 191 | to propagate properties from the server call to this new client call, |
| 192 | depending on the value of \a propagation_mask (see propagation_bits.h for |
| 193 | possible values). */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 194 | GRPCAPI grpc_call *grpc_channel_create_call( |
Craig Tiller | d6546c9 | 2016-01-29 07:59:35 -0800 | [diff] [blame] | 195 | grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 196 | grpc_completion_queue *completion_queue, grpc_slice method, |
| 197 | const grpc_slice *host, gpr_timespec deadline, void *reserved); |
Craig Tiller | 034929c | 2015-02-02 16:56:15 -0800 | [diff] [blame] | 198 | |
Craig Tiller | e2c6237 | 2015-12-07 16:11:03 -0800 | [diff] [blame] | 199 | /** Ping the channels peer (load balanced channels will select one sub-channel |
Craig Tiller | 26dab31 | 2015-12-07 14:43:47 -0800 | [diff] [blame] | 200 | to ping); if the channel is not connected, posts a failed. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 201 | GRPCAPI void grpc_channel_ping(grpc_channel *channel, grpc_completion_queue *cq, |
| 202 | void *tag, void *reserved); |
Craig Tiller | 26dab31 | 2015-12-07 14:43:47 -0800 | [diff] [blame] | 203 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 204 | /** Pre-register a method/host pair on a channel. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 205 | GRPCAPI void *grpc_channel_register_call(grpc_channel *channel, |
| 206 | const char *method, const char *host, |
| 207 | void *reserved); |
Craig Tiller | 0845337 | 2015-04-10 16:05:38 -0700 | [diff] [blame] | 208 | |
David Garcia Quintas | 15eba13 | 2016-08-09 15:20:48 -0700 | [diff] [blame] | 209 | /** Create a call given a handle returned from grpc_channel_register_call. |
| 210 | \sa grpc_channel_create_call. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 211 | GRPCAPI grpc_call *grpc_channel_create_registered_call( |
Craig Tiller | 7536af0 | 2015-12-22 13:49:30 -0800 | [diff] [blame] | 212 | grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, |
Craig Tiller | 3e7c6a7 | 2015-07-31 16:17:04 -0700 | [diff] [blame] | 213 | grpc_completion_queue *completion_queue, void *registered_call_handle, |
Nicolas "Pixel" Noble | 9d72b14 | 2015-08-08 01:45:38 +0200 | [diff] [blame] | 214 | gpr_timespec deadline, void *reserved); |
Craig Tiller | 0845337 | 2015-04-10 16:05:38 -0700 | [diff] [blame] | 215 | |
Craig Tiller | 5845091 | 2017-03-16 09:42:43 -0700 | [diff] [blame] | 216 | /** Allocate memory in the grpc_call arena: this memory is automatically |
| 217 | discarded at call completion */ |
| 218 | GRPCAPI void *grpc_call_arena_alloc(grpc_call *call, size_t size); |
| 219 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 220 | /** Start a batch of operations defined in the array ops; when complete, post a |
| 221 | completion of type 'tag' to the completion queue bound to the call. |
| 222 | The order of ops specified in the batch has no significance. |
| 223 | Only one operation of each type can be active at once in any given |
Nathaniel Manista | c00d0f7 | 2016-11-30 23:16:42 +0000 | [diff] [blame] | 224 | batch. |
| 225 | If a call to grpc_call_start_batch returns GRPC_CALL_OK you must call |
| 226 | grpc_completion_queue_next or grpc_completion_queue_pluck on the completion |
| 227 | queue associated with 'call' for work to be performed. If a call to |
| 228 | grpc_call_start_batch returns any value other than GRPC_CALL_OK it is |
| 229 | guaranteed that no state associated with 'call' is changed and it is not |
| 230 | appropriate to call grpc_completion_queue_next or |
| 231 | grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch |
| 232 | call. |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 233 | THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment |
| 234 | needs to be synchronized. As an optimization, you may synchronize batches |
| 235 | containing just send operations independently from batches containing just |
| 236 | receive operations. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 237 | GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call, |
| 238 | const grpc_op *ops, size_t nops, |
| 239 | void *tag, void *reserved); |
Craig Tiller | fef7669 | 2015-02-02 16:44:26 -0800 | [diff] [blame] | 240 | |
Craig Tiller | 4524942 | 2015-07-20 16:16:35 -0700 | [diff] [blame] | 241 | /** Returns a newly allocated string representing the endpoint to which this |
| 242 | call is communicating with. The string is in the uri format accepted by |
| 243 | grpc_channel_create. |
Alistair Veitch | ff32faf | 2015-07-30 09:54:15 -0700 | [diff] [blame] | 244 | The returned string should be disposed of with gpr_free(). |
Craig Tiller | 4524942 | 2015-07-20 16:16:35 -0700 | [diff] [blame] | 245 | |
| 246 | WARNING: this value is never authenticated or subject to any security |
| 247 | related code. It must not be used for any authentication related |
| 248 | functionality. Instead, use grpc_auth_context. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 249 | GRPCAPI char *grpc_call_get_peer(grpc_call *call); |
Craig Tiller | 1b22b9d | 2015-07-20 13:42:22 -0700 | [diff] [blame] | 250 | |
Alistair Veitch | ff32faf | 2015-07-30 09:54:15 -0700 | [diff] [blame] | 251 | struct census_context; |
| 252 | |
David Garcia Quintas | f31f096 | 2017-02-10 14:53:58 -0800 | [diff] [blame] | 253 | /** Set census context for a call; Must be called before first call to |
Alistair Veitch | ff32faf | 2015-07-30 09:54:15 -0700 | [diff] [blame] | 254 | grpc_call_start_batch(). */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 255 | GRPCAPI void grpc_census_call_set_context(grpc_call *call, |
| 256 | struct census_context *context); |
Alistair Veitch | ff32faf | 2015-07-30 09:54:15 -0700 | [diff] [blame] | 257 | |
David Garcia Quintas | f31f096 | 2017-02-10 14:53:58 -0800 | [diff] [blame] | 258 | /** Retrieve the calls current census context. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 259 | GRPCAPI struct census_context *grpc_census_call_get_context(grpc_call *call); |
Alistair Veitch | ff32faf | 2015-07-30 09:54:15 -0700 | [diff] [blame] | 260 | |
Craig Tiller | 4524942 | 2015-07-20 16:16:35 -0700 | [diff] [blame] | 261 | /** Return a newly allocated string representing the target a channel was |
| 262 | created for. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 263 | GRPCAPI char *grpc_channel_get_target(grpc_channel *channel); |
Craig Tiller | 4524942 | 2015-07-20 16:16:35 -0700 | [diff] [blame] | 264 | |
Mark D. Roth | f79ce7d | 2016-11-04 08:43:36 -0700 | [diff] [blame] | 265 | /** Request info about the channel. |
| 266 | \a channel_info indicates what information is being requested and |
| 267 | how that information will be returned. |
| 268 | \a channel_info is owned by the caller. */ |
Mark D. Roth | b2d2488 | 2016-10-27 15:44:07 -0700 | [diff] [blame] | 269 | GRPCAPI void grpc_channel_get_info(grpc_channel *channel, |
Mark D. Roth | f79ce7d | 2016-11-04 08:43:36 -0700 | [diff] [blame] | 270 | const grpc_channel_info *channel_info); |
Mark D. Roth | b2d2488 | 2016-10-27 15:44:07 -0700 | [diff] [blame] | 271 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 272 | /** Create a client channel to 'target'. Additional channel level configuration |
| 273 | MAY be provided by grpc_channel_args, though the expectation is that most |
| 274 | clients will want to simply pass NULL. See grpc_channel_args definition for |
| 275 | more on this. The data in 'args' need only live through the invocation of |
| 276 | this function. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 277 | GRPCAPI grpc_channel *grpc_insecure_channel_create( |
Craig Tiller | d6546c9 | 2016-01-29 07:59:35 -0800 | [diff] [blame] | 278 | const char *target, const grpc_channel_args *args, void *reserved); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 279 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 280 | /** Create a lame client: this client fails every operation attempted on it. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 281 | GRPCAPI grpc_channel *grpc_lame_client_channel_create( |
Craig Tiller | d6546c9 | 2016-01-29 07:59:35 -0800 | [diff] [blame] | 282 | const char *target, grpc_status_code error_code, const char *error_message); |
Craig Tiller | 42bc87c | 2015-02-23 08:50:19 -0800 | [diff] [blame] | 283 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 284 | /** Close and destroy a grpc channel */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 285 | GRPCAPI void grpc_channel_destroy(grpc_channel *channel); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 286 | |
Alexander Polcyn | d809a15 | 2017-05-03 14:49:41 -0700 | [diff] [blame] | 287 | /** Error handling for grpc_call |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 288 | Most grpc_call functions return a grpc_error. If the error is not GRPC_OK |
| 289 | then the operation failed due to some unsatisfied precondition. |
| 290 | If a grpc_call fails, it's guaranteed that no change to the call state |
| 291 | has been made. */ |
| 292 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 293 | /** Called by clients to cancel an RPC on the server. |
| 294 | Can be called multiple times, from any thread. |
| 295 | THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status |
Craig Tiller | dd36b15 | 2017-03-31 08:27:28 -0700 | [diff] [blame] | 296 | are thread-safe, and can be called at any point before grpc_call_unref |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 297 | is called.*/ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 298 | GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 299 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 300 | /** Called by clients to cancel an RPC on the server. |
| 301 | Can be called multiple times, from any thread. |
| 302 | If a status has not been received for the call, set it to the status code |
| 303 | and description passed in. |
| 304 | Importantly, this function does not send status nor description to the |
Alexander Polcyn | 088e85c | 2017-07-28 14:53:20 -0700 | [diff] [blame] | 305 | remote endpoint. |
| 306 | Note that \a description doesn't need be a static string. |
| 307 | It doesn't need to be alive after the call to |
| 308 | grpc_call_cancel_with_status completes. |
| 309 | */ |
Craig Tiller | f40df23 | 2016-03-25 13:38:14 -0700 | [diff] [blame] | 310 | GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call, |
| 311 | grpc_status_code status, |
| 312 | const char *description, |
| 313 | void *reserved); |
Craig Tiller | d248c24 | 2015-01-14 11:49:12 -0800 | [diff] [blame] | 314 | |
Craig Tiller | dd36b15 | 2017-03-31 08:27:28 -0700 | [diff] [blame] | 315 | /** Ref a call. |
Eric Dobson | 60092b0 | 2017-09-24 11:09:05 -0700 | [diff] [blame] | 316 | THREAD SAFETY: grpc_call_ref is thread-compatible */ |
Craig Tiller | dd36b15 | 2017-03-31 08:27:28 -0700 | [diff] [blame] | 317 | GRPCAPI void grpc_call_ref(grpc_call *call); |
| 318 | |
| 319 | /** Unref a call. |
| 320 | THREAD SAFETY: grpc_call_unref is thread-compatible */ |
| 321 | GRPCAPI void grpc_call_unref(grpc_call *call); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 322 | |
David G. Quintas | b2a1c59 | 2015-08-20 14:44:27 -0700 | [diff] [blame] | 323 | /** Request notification of a new call. |
Craig Tiller | ddf3a51 | 2015-09-24 13:03:44 -0700 | [diff] [blame] | 324 | Once a call is received, a notification tagged with \a tag_new is added to |
| 325 | \a cq_for_notification. \a call, \a details and \a request_metadata are |
Craig Tiller | 1359a12 | 2015-08-24 14:43:32 -0700 | [diff] [blame] | 326 | updated with the appropriate call information. \a cq_bound_to_call is bound |
| 327 | to \a call, and batch operation notifications for that call will be posted |
| 328 | to \a cq_bound_to_call. |
David G. Quintas | b2a1c59 | 2015-08-20 14:44:27 -0700 | [diff] [blame] | 329 | Note that \a cq_for_notification must have been registered to the server via |
| 330 | \a grpc_server_register_completion_queue. */ |
Craig Tiller | f40df23 | 2016-03-25 13:38:14 -0700 | [diff] [blame] | 331 | GRPCAPI grpc_call_error grpc_server_request_call( |
| 332 | grpc_server *server, grpc_call **call, grpc_call_details *details, |
| 333 | grpc_metadata_array *request_metadata, |
| 334 | grpc_completion_queue *cq_bound_to_call, |
| 335 | grpc_completion_queue *cq_for_notification, void *tag_new); |
Craig Tiller | 034929c | 2015-02-02 16:56:15 -0800 | [diff] [blame] | 336 | |
Craig Tiller | 06cb1a9 | 2016-04-04 08:10:47 -0700 | [diff] [blame] | 337 | /** How to handle payloads for a registered method */ |
| 338 | typedef enum { |
| 339 | /** Don't try to read the payload */ |
| 340 | GRPC_SRM_PAYLOAD_NONE, |
| 341 | /** Read the initial payload as a byte buffer */ |
| 342 | GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER |
| 343 | } grpc_server_register_method_payload_handling; |
| 344 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 345 | /** Registers a method in the server. |
| 346 | Methods to this (host, method) pair will not be reported by |
| 347 | grpc_server_request_call, but instead be reported by |
| 348 | grpc_server_request_registered_call when passed the appropriate |
| 349 | registered_method (as returned by this function). |
| 350 | Must be called before grpc_server_start. |
| 351 | Returns NULL on failure. */ |
Craig Tiller | 06cb1a9 | 2016-04-04 08:10:47 -0700 | [diff] [blame] | 352 | GRPCAPI void *grpc_server_register_method( |
| 353 | grpc_server *server, const char *method, const char *host, |
| 354 | grpc_server_register_method_payload_handling payload_handling, |
| 355 | uint32_t flags); |
Craig Tiller | 24be0f7 | 2015-02-10 14:04:22 -0800 | [diff] [blame] | 356 | |
Alistair Veitch | ff32faf | 2015-07-30 09:54:15 -0700 | [diff] [blame] | 357 | /** Request notification of a new pre-registered call. 'cq_for_notification' |
| 358 | must have been registered to the server via |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 359 | grpc_server_register_completion_queue. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 360 | GRPCAPI grpc_call_error grpc_server_request_registered_call( |
Craig Tiller | 24be0f7 | 2015-02-10 14:04:22 -0800 | [diff] [blame] | 361 | grpc_server *server, void *registered_method, grpc_call **call, |
| 362 | gpr_timespec *deadline, grpc_metadata_array *request_metadata, |
| 363 | grpc_byte_buffer **optional_payload, |
Craig Tiller | f9e6adf | 2015-05-06 11:45:59 -0700 | [diff] [blame] | 364 | grpc_completion_queue *cq_bound_to_call, |
| 365 | grpc_completion_queue *cq_for_notification, void *tag_new); |
Craig Tiller | 24be0f7 | 2015-02-10 14:04:22 -0800 | [diff] [blame] | 366 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 367 | /** Create a server. Additional configuration for each incoming channel can |
| 368 | be specified with args. If no additional configuration is needed, args can |
| 369 | be NULL. See grpc_channel_args for more. The data in 'args' need only live |
| 370 | through the invocation of this function. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 371 | GRPCAPI grpc_server *grpc_server_create(const grpc_channel_args *args, |
| 372 | void *reserved); |
Craig Tiller | f9e6adf | 2015-05-06 11:45:59 -0700 | [diff] [blame] | 373 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 374 | /** Register a completion queue with the server. Must be done for any |
| 375 | notification completion queue that is passed to grpc_server_request_*_call |
| 376 | and to grpc_server_shutdown_and_notify. Must be performed prior to |
| 377 | grpc_server_start. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 378 | GRPCAPI void grpc_server_register_completion_queue(grpc_server *server, |
| 379 | grpc_completion_queue *cq, |
| 380 | void *reserved); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 381 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 382 | /** Add a HTTP2 over plaintext over tcp listener. |
| 383 | Returns bound port number on success, 0 on failure. |
| 384 | REQUIRES: server not started */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 385 | GRPCAPI int grpc_server_add_insecure_http2_port(grpc_server *server, |
| 386 | const char *addr); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 387 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 388 | /** Start a server - tells all listeners to start listening */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 389 | GRPCAPI void grpc_server_start(grpc_server *server); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 390 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 391 | /** Begin shutting down a server. |
| 392 | After completion, no new calls or connections will be admitted. |
| 393 | Existing calls will be allowed to complete. |
| 394 | Send a GRPC_OP_COMPLETE event when there are no more calls being serviced. |
| 395 | Shutdown is idempotent, and all tags will be notified at once if multiple |
| 396 | grpc_server_shutdown_and_notify calls are made. 'cq' must have been |
| 397 | registered to this server via grpc_server_register_completion_queue. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 398 | GRPCAPI void grpc_server_shutdown_and_notify(grpc_server *server, |
| 399 | grpc_completion_queue *cq, |
| 400 | void *tag); |
Craig Tiller | 4ffdcd5 | 2015-01-16 11:34:55 -0800 | [diff] [blame] | 401 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 402 | /** Cancel all in-progress calls. |
| 403 | Only usable after shutdown. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 404 | GRPCAPI void grpc_server_cancel_all_calls(grpc_server *server); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 405 | |
Craig Tiller | 2d984bf | 2015-07-20 15:01:38 -0700 | [diff] [blame] | 406 | /** Destroy a server. |
| 407 | Shutdown must have completed beforehand (i.e. all tags generated by |
| 408 | grpc_server_shutdown_and_notify must have been received, and at least |
| 409 | one call to grpc_server_shutdown_and_notify must have been made). */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 410 | GRPCAPI void grpc_server_destroy(grpc_server *server); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 411 | |
Craig Tiller | af7abf9 | 2015-06-03 17:18:58 -0700 | [diff] [blame] | 412 | /** Enable or disable a tracer. |
| 413 | |
| 414 | Tracers (usually controlled by the environment variable GRPC_TRACE) |
| 415 | allow printf-style debugging on GRPC internals, and are useful for |
Craig Tiller | 9a57633 | 2015-06-17 10:21:49 -0700 | [diff] [blame] | 416 | tracking down problems in the field. |
Craig Tiller | af7abf9 | 2015-06-03 17:18:58 -0700 | [diff] [blame] | 417 | |
Craig Tiller | 9a57633 | 2015-06-17 10:21:49 -0700 | [diff] [blame] | 418 | Use of this function is not strictly thread-safe, but the |
Craig Tiller | af7abf9 | 2015-06-03 17:18:58 -0700 | [diff] [blame] | 419 | thread-safety issues raised by it should not be of concern. */ |
Nicolas "Pixel" Noble | cd41a0b | 2016-02-08 22:53:14 +0100 | [diff] [blame] | 420 | GRPCAPI int grpc_tracer_set_enabled(const char *name, int enabled); |
Craig Tiller | af7abf9 | 2015-06-03 17:18:58 -0700 | [diff] [blame] | 421 | |
murgatroid99 | c3910ca | 2016-01-06 13:14:23 -0800 | [diff] [blame] | 422 | /** Check whether a metadata key is legal (will be accepted by core) */ |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 423 | GRPCAPI int grpc_header_key_is_legal(grpc_slice slice); |
murgatroid99 | c3910ca | 2016-01-06 13:14:23 -0800 | [diff] [blame] | 424 | |
| 425 | /** Check whether a non-binary metadata value is legal (will be accepted by |
| 426 | core) */ |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 427 | GRPCAPI int grpc_header_nonbin_value_is_legal(grpc_slice slice); |
murgatroid99 | c3910ca | 2016-01-06 13:14:23 -0800 | [diff] [blame] | 428 | |
| 429 | /** Check whether a metadata key corresponds to a binary value */ |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 430 | GRPCAPI int grpc_is_binary_header(grpc_slice slice); |
murgatroid99 | c3910ca | 2016-01-06 13:14:23 -0800 | [diff] [blame] | 431 | |
Yuchen Zeng | 2e7d957 | 2016-04-15 17:29:57 -0700 | [diff] [blame] | 432 | /** Convert grpc_call_error values to a string */ |
| 433 | GRPCAPI const char *grpc_call_error_to_string(grpc_call_error error); |
| 434 | |
Craig Tiller | c2ab9ae | 2016-09-22 09:57:29 -0700 | [diff] [blame] | 435 | /** Create a buffer pool */ |
Craig Tiller | 20afa3d | 2016-10-17 14:52:14 -0700 | [diff] [blame] | 436 | GRPCAPI grpc_resource_quota *grpc_resource_quota_create(const char *trace_name); |
Craig Tiller | c2ab9ae | 2016-09-22 09:57:29 -0700 | [diff] [blame] | 437 | |
| 438 | /** Add a reference to a buffer pool */ |
Craig Tiller | 20afa3d | 2016-10-17 14:52:14 -0700 | [diff] [blame] | 439 | GRPCAPI void grpc_resource_quota_ref(grpc_resource_quota *resource_quota); |
Craig Tiller | c2ab9ae | 2016-09-22 09:57:29 -0700 | [diff] [blame] | 440 | |
| 441 | /** Drop a reference to a buffer pool */ |
Craig Tiller | 20afa3d | 2016-10-17 14:52:14 -0700 | [diff] [blame] | 442 | GRPCAPI void grpc_resource_quota_unref(grpc_resource_quota *resource_quota); |
Craig Tiller | c2ab9ae | 2016-09-22 09:57:29 -0700 | [diff] [blame] | 443 | |
| 444 | /** Update the size of a buffer pool */ |
Craig Tiller | 20afa3d | 2016-10-17 14:52:14 -0700 | [diff] [blame] | 445 | GRPCAPI void grpc_resource_quota_resize(grpc_resource_quota *resource_quota, |
| 446 | size_t new_size); |
Craig Tiller | c2ab9ae | 2016-09-22 09:57:29 -0700 | [diff] [blame] | 447 | |
Craig Tiller | 20afa3d | 2016-10-17 14:52:14 -0700 | [diff] [blame] | 448 | /** Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota |
| 449 | */ |
| 450 | GRPCAPI const grpc_arg_pointer_vtable *grpc_resource_quota_arg_vtable(void); |
Craig Tiller | c2ab9ae | 2016-09-22 09:57:29 -0700 | [diff] [blame] | 451 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 452 | #ifdef __cplusplus |
| 453 | } |
| 454 | #endif |
| 455 | |
Craig Tiller | b20111c | 2015-04-10 23:27:11 +0000 | [diff] [blame] | 456 | #endif /* GRPC_GRPC_H */ |