GRPC C++
1.26.0
|
#include <call_combiner.h>
Public Member Functions | |
CallCombiner () | |
~CallCombiner () | |
void | Start (grpc_closure *closure, grpc_error *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... | |
void | SetNotifyOnCancel (grpc_closure *closure) |
Registers closure to be invoked when Cancel() is called. More... | |
void | Cancel (grpc_error *error) |
Indicates that the call has been cancelled. More... | |
grpc_core::CallCombiner::CallCombiner | ( | ) |
grpc_core::CallCombiner::~CallCombiner | ( | ) |
void grpc_core::CallCombiner::Cancel | ( | grpc_error * | error | ) |
Indicates that the call has been cancelled.
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. Filters that schedule the cancellation closure on ExecCtx do not need to take a ref on the call stack to guarantee closure liveness. This is done by explicitly flushing ExecCtx after the unregistration during call destruction.
void grpc_core::CallCombiner::Start | ( | grpc_closure * | closure, |
grpc_error * | error, | ||
const char * | file, | ||
int | line, | ||
const char * | reason | ||
) |
Starts processing closure.
void grpc_core::CallCombiner::Stop | ( | const char * | file, |
int | line, | ||
const char * | reason | ||
) |
Yields the call combiner to the next closure in the queue, if any.