PMDK C++ bindings
1.13.0-git23.gf49772ac
This is the C++ bindings documentation for PMDK's libpmemobj.
|
mpsc_queue producer worker class. More...
#include <libpmemobj++/experimental/mpsc_queue.hpp>
Public Member Functions | |
template<typename Function = void (*)(pmem::obj::string_view)> | |
bool | try_produce (pmem::obj::string_view data, Function &&on_produce=[](pmem::obj::string_view target) {}) |
Copies data from pmem::obj::string_view into the mpsc_queue. More... | |
mpsc_queue producer worker class.
To write data concurrently into the mpsc_queue in the multi-threaded application, each producer thread have to use its own worker object. Workers might be added concurrently to the mpsc_queue.
bool pmem::obj::experimental::mpsc_queue::worker::try_produce | ( | pmem::obj::string_view | data, |
Function && | on_produce = [](pmem::obj::string_view target) {} |
||
) |
Copies data from pmem::obj::string_view into the mpsc_queue.
[in] | data | Data to be copied into mpsc_queue |
[in] | on_produce | Function evaluated on the data in queue, before the data is visible for the consumer. By default do nothing. |