RDMA++
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
rdmapp::executor Class Reference

This class is used to execute callbacks of completion entries. More...

#include <rdmapp/executor.h>

Public Types

using queue_closed_error = work_queue::queue_closed_error
 
using callback_fn = std::function< void(struct ibv_wc const &wc)>
 
using callback_ptr = callback_fn *
 

Public Member Functions

 executor (size_t nr_worker=4)
 Construct a new executor object.
 
void process_wc (struct ibv_wc const &wc)
 Process a completion entry.
 
void shutdown ()
 Shutdown the executor.
 

Static Public Member Functions

template<class T >
static callback_ptr make_callback (T const &cb)
 Make a callback function that will be called when a completion entry is processed. The callback function will be called in the executor's thread. The lifetime of this pointer is controlled by the executor.
 
static void destroy_callback (callback_ptr cb)
 Destroy a callback function.
 

Detailed Description

This class is used to execute callbacks of completion entries.

Constructor & Destructor Documentation

◆ executor()

rdmapp::executor::executor ( size_t  nr_worker = 4)

Construct a new executor object.

Parameters
nr_workerThe number of worker threads to use.

Member Function Documentation

◆ destroy_callback()

void rdmapp::executor::destroy_callback ( callback_ptr  cb)
static

Destroy a callback function.

Parameters
cbThe callback function pointer.

◆ make_callback()

template<class T >
static callback_ptr rdmapp::executor::make_callback ( T const &  cb)
inlinestatic

Make a callback function that will be called when a completion entry is processed. The callback function will be called in the executor's thread. The lifetime of this pointer is controlled by the executor.

Template Parameters
TThe type of the callback function.
Parameters
cbThe callback function.
Returns
callback_ptr The callback function pointer.

◆ process_wc()

void rdmapp::executor::process_wc ( struct ibv_wc const &  wc)

Process a completion entry.

Parameters
wcThe completion entry to process.

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