aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Julien Boeuf <jboeuf@google.com>2015-08-05 21:29:42 -0700
committerGravatar Julien Boeuf <jboeuf@google.com>2015-08-05 21:29:42 -0700
commitd3368e419253b5dc82662740031723f1909a97ba (patch)
tree38504ff129245fd643bef86bbabf0d11395f1e47 /include
parent7c8d255527cbec8b261300296d61361ce94e9d18 (diff)
parent7098b1ba645074c47675a731243aa929c67bb46f (diff)
Merge branch 'master' of github.com:grpc/grpc into server_creds_auth_md_processor
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/server_context.h10
-rw-r--r--include/grpc++/stub_options.h43
-rw-r--r--include/grpc/grpc.h11
3 files changed, 62 insertions, 2 deletions
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h
index cf2732b33d..23273f43e6 100644
--- a/include/grpc++/server_context.h
+++ b/include/grpc++/server_context.h
@@ -125,6 +125,14 @@ class ServerContext {
const struct census_context* census_context() const;
+ // Async only. Has to be called before the rpc starts.
+ // Returns the tag in completion queue when the rpc finishes.
+ // IsCancelled() can then be called to check whether the rpc was cancelled.
+ void AsyncNotifyWhenDone(void* tag) {
+ has_notify_when_done_tag_ = true;
+ async_notify_when_done_tag_ = tag;
+ }
+
private:
friend class ::grpc::testing::InteropContextInspector;
friend class ::grpc::Server;
@@ -165,6 +173,8 @@ class ServerContext {
void set_call(grpc_call* call);
CompletionOp* completion_op_;
+ bool has_notify_when_done_tag_;
+ void* async_notify_when_done_tag_;
gpr_timespec deadline_;
grpc_call* call_;
diff --git a/include/grpc++/stub_options.h b/include/grpc++/stub_options.h
new file mode 100644
index 0000000000..c7c16dcd55
--- /dev/null
+++ b/include/grpc++/stub_options.h
@@ -0,0 +1,43 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPCXX_STUB_OPTIONS_H
+#define GRPCXX_STUB_OPTIONS_H
+
+namespace grpc {
+
+class StubOptions {};
+
+} // namespace grpc
+
+#endif // GRPCXX_STUB_OPTIONS_H
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 616aab7a81..15556a6d5c 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -391,10 +391,17 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
otherwise a grpc_event describing the event that occurred.
Callers must not call grpc_completion_queue_next and
- grpc_completion_queue_pluck simultaneously on the same completion queue. */
+ grpc_completion_queue_pluck simultaneously on the same completion queue.
+
+ Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS
+ concurrently executing plucks at any time. */
grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag,
gpr_timespec deadline);
+/** Maximum number of outstanding grpc_completion_queue_pluck executions per
+ completion queue */
+#define GRPC_MAX_COMPLETION_QUEUE_PLUCKERS 6
+
/** Begin destruction of a completion queue. Once all possible events are
drained then grpc_completion_queue_next will start to produce
GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call
@@ -562,7 +569,7 @@ void grpc_server_register_completion_queue(grpc_server *server,
/** Add a HTTP2 over plaintext over tcp listener.
Returns bound port number on success, 0 on failure.
REQUIRES: server not started */
-int grpc_server_add_http2_port(grpc_server *server, const char *addr);
+int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr);
/** Start a server - tells all listeners to start listening */
void grpc_server_start(grpc_server *server);