GRPC Core  9.0.0
Public Member Functions
grpc_core::CallCombiner Class Reference

#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...
 

Constructor & Destructor Documentation

◆ CallCombiner()

grpc_core::CallCombiner::CallCombiner ( )

◆ ~CallCombiner()

grpc_core::CallCombiner::~CallCombiner ( )

Member Function Documentation

◆ Cancel()

void grpc_core::CallCombiner::Cancel ( grpc_error error)

Indicates that the call has been cancelled.

◆ SetNotifyOnCancel()

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 Cancel() was called prior to registering the closure, it will be scheduled immediately with the cancelation error.
  • If Cancel() is called after registering the closure, the closure will be scheduled with the cancellation error.
  • If SetNotifyOnCancel() is called again to register a new cancellation closure, the previous cancellation closure will be scheduled with GRPC_ERROR_NONE.

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.

◆ Start()

void grpc_core::CallCombiner::Start ( grpc_closure closure,
grpc_error error,
const char *  file,
int  line,
const char *  reason 
)

Starts processing closure.

◆ Stop()

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.


The documentation for this class was generated from the following files: