#include <call_combiner.h>
Public Member Functions | |
CallCombiner () | |
void | Cancel (grpc_error_handle error) |
Indicates that the call has been cancelled. More... | |
void | SetNotifyOnCancel (grpc_closure *closure) |
void | Start (grpc_closure *closure, grpc_error_handle error, const char *file, int line, const char *reason) |
Starts processing closure. More... | |
void | Stop (const char *file, int line, const char *reason) |
Yields the call combiner to the next closure in the queue, if any. More... | |
~CallCombiner () | |
Private Member Functions | |
void | ScheduleClosure (grpc_closure *closure, grpc_error_handle error) |
Private Attributes | |
gpr_atm | cancel_state_ = 0 |
MultiProducerSingleConsumerQueue | queue_ |
gpr_atm | size_ = 0 |
Definition at line 50 of file call_combiner.h.
grpc_core::CallCombiner::CallCombiner | ( | ) |
Definition at line 52 of file call_combiner.cc.
grpc_core::CallCombiner::~CallCombiner | ( | ) |
Definition at line 61 of file call_combiner.cc.
void grpc_core::CallCombiner::Cancel | ( | grpc_error_handle | error | ) |
Indicates that the call has been cancelled.
Definition at line 255 of file call_combiner.cc.
|
private |
Definition at line 103 of file call_combiner.cc.
void grpc_core::CallCombiner::SetNotifyOnCancel | ( | grpc_closure * | closure | ) |
Registers closure to be invoked when Cancel() is called.
Once a closure is registered, it will always be scheduled exactly once; this allows the closure to hold references that will be freed regardless of whether or not the call was cancelled. If a cancellation does occur, the closure will be scheduled with the cancellation error; otherwise, it will be scheduled with GRPC_ERROR_NONE.
The closure will be scheduled in the following cases:
If closure is NULL, then no closure will be invoked on cancellation; this effectively unregisters the previously set closure. However, most filters will not need to explicitly unregister their callbacks, as this is done automatically when the call is destroyed.
Definition at line 212 of file call_combiner.cc.
void grpc_core::CallCombiner::Start | ( | grpc_closure * | closure, |
grpc_error_handle | error, | ||
const char * | file, | ||
int | line, | ||
const char * | reason | ||
) |
Starts processing closure.
Definition at line 123 of file call_combiner.cc.
Yields the call combiner to the next closure in the queue, if any.
Definition at line 163 of file call_combiner.cc.
|
private |
Definition at line 114 of file call_combiner.h.
|
private |
Definition at line 110 of file call_combiner.h.
|
private |
Definition at line 109 of file call_combiner.h.