feat(producer) add specified order producer
diff --git a/src/PythonWrapper.cpp b/src/PythonWrapper.cpp
index 2783015..5fb1d53 100644
--- a/src/PythonWrapper.cpp
+++ b/src/PythonWrapper.cpp
@@ -124,6 +124,11 @@
return (void *) CreateProducer(groupId);
}
+void *PyCreateOrderProducer(const char *groupId) {
+ PyEval_InitThreads(); // ensure create GIL, for call Python callback from C.
+ return (void *) CreateOrderlyProducer(groupId);
+}
+
void *PyCreateTransactionProducer(const char *groupId, PyObject *localTransactionCheckerCallback) {
PyEval_InitThreads();
CProducer *producer = CreateTransactionProducer(groupId, &PyLocalTransactionCheckerCallback, NULL);
@@ -474,6 +479,7 @@
//For producer
def("CreateProducer", PyCreateProducer, return_value_policy<return_opaque_pointer>());
+ def("CreateOrderProducer", PyCreateOrderProducer, return_value_policy<return_opaque_pointer>());
def("CreateTransactionProducer", PyCreateTransactionProducer, return_value_policy<return_opaque_pointer>());
def("DestroyProducer", PyDestroyProducer);
def("DestroyTransactionProducer", PyDestroyTransactionProducer);
diff --git a/src/PythonWrapper.h b/src/PythonWrapper.h
index 732320b..8fdb04f 100644
--- a/src/PythonWrapper.h
+++ b/src/PythonWrapper.h
@@ -100,6 +100,7 @@
//producer
void *PyCreateProducer(const char *groupId);
+void *PyCreateOrderProducer(const char *groupId);
CTransactionStatus PyLocalTransactionCheckerCallback(CProducer *producer, CMessageExt *msg, void *data);
CTransactionStatus PyLocalTransactionExecuteCallback(CProducer *producer, CMessage *msg, void *data);
void *PyCreateTransactionProducer(const char *groupId, PyObject *localTransactionCheckerCallback);