in src/producer.cc [54:86]
void export_producer(py::module_& m) {
using namespace py;
class_<Producer>(m, "Producer")
.def(init<>())
.def("topic", &Producer::getTopic, "return the topic to which producer is publishing to",
return_value_policy::copy)
.def("producer_name", &Producer::getProducerName,
"return the producer name which could have been assigned by the system or specified by the "
"client",
return_value_policy::copy)
.def("last_sequence_id", &Producer::getLastSequenceId)
.def("send", &Producer_send,
"Publish a message on the topic associated with this Producer.\n"
"\n"
"This method will block until the message will be accepted and persisted\n"
"by the broker. In case of errors, the client library will try to\n"
"automatically recover and use a different broker.\n"
"\n"
"If it wasn't possible to successfully publish the message within the sendTimeout,\n"
"an error will be returned.\n"
"\n"
"This method is equivalent to asyncSend() and wait until the callback is triggered.\n"
"\n"
"@param msg message to publish\n")
.def("send_async", &Producer_sendAsync)
.def("flush", &Producer_flush,
"Flush all the messages buffered in the client and wait until all messages have been\n"
"successfully persisted\n")
.def("close", &Producer_close)
.def("close_async", &Producer_closeAsync)
.def("is_connected", &Producer::isConnected);
}