You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "RobertIndie (via GitHub)" <gi...@apache.org> on 2023/03/07 02:38:51 UTC
[GitHub] [pulsar-client-python] RobertIndie commented on a diff in pull request #99: Wrap the interruption to a custom exception when a blocking API is interrupted
RobertIndie commented on code in PR #99:
URL: https://github.com/apache/pulsar-client-python/pull/99#discussion_r1122665602
##########
src/producer.cc:
##########
@@ -25,21 +25,15 @@
namespace py = pybind11;
MessageId Producer_send(Producer& producer, const Message& message) {
- MessageId messageId;
-
- waitForAsyncValue(std::function<void(SendCallback)>(
- [&](SendCallback callback) { producer.sendAsync(message, callback); }),
- messageId);
-
- return messageId;
+ return waitForAsyncValue<MessageId>(
+ [&](SendCallback callback) { producer.sendAsync(message, callback); });
}
void Producer_sendAsync(Producer& producer, const Message& msg, SendCallback callback) {
- Py_BEGIN_ALLOW_THREADS
- producer.sendAsync(msg, callback);
+ Py_BEGIN_ALLOW_THREADS producer.sendAsync(msg, callback);
Py_END_ALLOW_THREADS
- if (PyErr_CheckSignals() == -1) {
+ if (PyErr_CheckSignals() == -1) {
Review Comment:
Is this intentional?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org