47 #ifndef GRPCXX_IMPL_CODEGEN_COMPLETION_QUEUE_H
48 #define GRPCXX_IMPL_CODEGEN_COMPLETION_QUEUE_H
65 template <
class W,
class R>
66 class ClientReaderWriter;
72 template <
class W,
class R>
75 template <
class ServiceType,
class RequestType,
class ResponseType>
77 template <
class ServiceType,
class RequestType,
class ResponseType>
79 template <
class ServiceType,
class RequestType,
class ResponseType>
81 template <
class ServiceType,
class RequestType,
class ResponseType>
137 template <
typename T>
140 return AsyncNextInternal(tag, ok, deadline_tp.
raw_time());
150 bool Next(
void** tag,
bool* ok) {
184 static_cast<gpr_atm>(1));
202 friend class ::grpc::ClientReader;
204 friend class ::grpc::ClientWriter;
205 template <
class W,
class R>
206 friend class ::grpc::ClientReaderWriter;
208 friend class ::grpc::ServerReader;
210 friend class ::grpc::ServerWriter;
211 template <
class W,
class R>
212 friend class ::grpc::internal::ServerReaderWriterBody;
213 template <
class ServiceType,
class RequestType,
class ResponseType>
215 template <
class ServiceType,
class RequestType,
class ResponseType>
217 template <
class ServiceType,
class RequestType,
class ResponseType>
219 template <
class Streamer,
bool WriteNeeded>
222 friend class ::grpc::Server;
223 friend class ::grpc::ServerContext;
224 template <
class InputMessage,
class OutputMessage>
228 const InputMessage& request,
229 OutputMessage* result);
239 cq_, tag, deadline,
nullptr);
245 return ev.success != 0;
259 cq_, tag, deadline,
nullptr);
272 void TryPluck(CompletionQueueTag* tag,
gpr_timespec deadline) {
274 cq_, tag, deadline,
nullptr);
305 polling_type_(polling_type) {}
310 #endif // GRPCXX_IMPL_CODEGEN_COMPLETION_QUEUE_H
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:40
virtual const grpc_completion_queue_factory * grpc_completion_queue_factory_lookup(const grpc_completion_queue_attributes *attributes)=0
friend Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, ClientContext *context, const InputMessage &request, OutputMessage *result)
Wrapper that performs a blocking unary call.
Definition: client_unary_call.h:52
virtual gpr_timespec gpr_inf_future(gpr_clock_type type)=0
virtual bool FinalizeResult(void **tag, bool *status)=0
Called prior to returning from Next(), return value is the status of the operation (return status is ...
Definition: completion_queue.h:73
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:137
Got a new event; tag will be filled in with its associated value; ok indicating its success...
Definition: completion_queue.h:122
No event before timeout.
Definition: grpc_types.h:405
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:41
int success
If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates whether the operation was succe...
Definition: grpc_types.h:421
#define GRPC_CQ_CURRENT_VERSION
Definition: grpc_types.h:601
The completion queue has been shutdown.
Definition: completion_queue.h:121
Events are popped out by calling grpc_completion_queue_next() API ONLY.
Definition: grpc_types.h:595
gpr_timespec raw_time()
Definition: time.h:56
#define gpr_atm_no_barrier_fetch_add(p, delta)
Definition: atm_gcc_atomic.h:67
bool IsFrequentlyPolled()
Definition: completion_queue.h:293
virtual void grpc_completion_queue_destroy(grpc_completion_queue *cq)=0
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:52
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:53
Definition: grpc_types.h:602
grpc_completion_queue * cq()
Returns a raw pointer to the underlying grpc_completion_queue instance.
Definition: completion_queue.h:171
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:168
Synchronous (blocking) server-side API for doing client-streaming RPCs, where the incoming message st...
Definition: completion_queue.h:68
bool Next(void **tag, bool *ok)
Read from the queue, blocking until an event is available or the queue is shutting down...
Definition: completion_queue.h:150
void RegisterAvalanching()
Definition: completion_queue.h:182
Handle unknown method by returning UNIMPLEMENTED error.
Definition: method_handler_impl.h:253
grpc_cq_polling_type
Completion queues internally MAY maintain a set of file descriptors in a structure called 'pollset'...
Definition: grpc_types.h:575
CompletionQueue(const grpc_completion_queue_attributes &attributes)
Private constructor of CompletionQueue only visible to friend classes.
Definition: completion_queue.h:190
Shutting down.
Definition: grpc_types.h:403
A wrapper class of an application provided bidi-streaming handler.
Definition: method_handler_impl.h:177
NextStatus AsyncNext(void **tag, bool *ok, const T &deadline)
Read from the queue, blocking up to deadline (or the queue's shutdown).
Definition: completion_queue.h:138
~CompletionQueue()
Destructor. Destroys the owned wrapped completion queue / instance.
Definition: completion_queue.h:115
Represents a gRPC server.
Definition: server.h:67
A wrapper class of an application provided rpc method handler.
Definition: completion_queue.h:76
void Shutdown()
Request the shutdown of the queue.
virtual grpc_completion_queue * grpc_completion_queue_create(const grpc_completion_queue_factory *factory, const grpc_completion_queue_attributes *attributes, void *reserved)=0
void CompleteAvalanching()
Codegen interface for grpc::Channel.
Definition: channel_interface.h:64
CoreCodegenInterface * g_core_codegen_interface
Definition: call.h:64
NextStatus
Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT.
Definition: completion_queue.h:120
The completion queue will have an associated pollset and there is no restriction on the type of file ...
Definition: grpc_types.h:578
Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will not contain any 'listening ...
Definition: grpc_types.h:583
CompletionQueue()
Default constructor.
Definition: completion_queue.h:105
A ServerContext allows the person implementing a service handler to:
Definition: server_context.h:109
Realtime clock.
Definition: gpr_types.h:51
Synchronous (blocking) server-side API for doing for doing a server-streaming RPCs, where the outgoing message stream coming from the server has messages of type W.
Definition: completion_queue.h:70
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:101
void InitialAvalanching()
Manage state of avalanching operations : completion queue tags that trigger other completion queue op...
Definition: completion_queue.h:179
A wrapper class of an application provided client streaming handler.
Definition: completion_queue.h:78
Descriptor of an RPC method.
Definition: rpc_method.h:44
#define gpr_atm_rel_store(p, value)
Definition: atm_gcc_atomic.h:62
Interface between the codegen library and the minimal subset of core features required by the generat...
Definition: core_codegen_interface.h:56
A wrapper class of an application provided server streaming handler.
Definition: completion_queue.h:80
Did it work? If it didn't, why?
Definition: status.h:45
Analogous to struct timespec.
Definition: gpr_types.h:62
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue.h:291
struct grpc_completion_queue grpc_completion_queue
Completion Queues enable notification of the completion of asynchronous actions.
Definition: grpc_types.h:72
virtual gpr_timespec gpr_time_0(gpr_clock_type type)=0
Definition: completion_queue.h:82
A builder class for the creation and startup of grpc::Server instances.
Definition: server_builder.h:69
deadline was reached.
Definition: completion_queue.h:124
virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, gpr_timespec deadline, void *reserved)=0
Channels represent a connection to an endpoint. Created by CreateChannel.
Definition: channel.h:49