pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ivankelly commented on a change in pull request #3067: PIP-25: C++ / Python / Go implementation for token authentication
Date Wed, 28 Nov 2018 11:20:51 GMT
ivankelly commented on a change in pull request #3067: PIP-25: C++ / Python / Go implementation
for token authentication
URL: https://github.com/apache/pulsar/pull/3067#discussion_r237041810
 
 

 ##########
 File path: pulsar-client-cpp/python/src/authentication.cc
 ##########
 @@ -32,6 +32,59 @@ struct AuthenticationTlsWrapper : public AuthenticationWrapper {
     }
 };
 
+struct TokenSupplierWrapper {
+    PyObject* _pySupplier;
+
+    TokenSupplierWrapper(py::object pySupplier) :
+        _pySupplier(pySupplier.ptr()) {
+        Py_XINCREF(_pySupplier);
+    }
+
+    TokenSupplierWrapper(const TokenSupplierWrapper& other) {
+        _pySupplier= other._pySupplier;
+        Py_XINCREF(_pySupplier);
+    }
+
+    TokenSupplierWrapper& operator=(const TokenSupplierWrapper& other) {
+        _pySupplier = other._pySupplier;
+        Py_XINCREF(_pySupplier);
+        return *this;
+    }
+
+    virtual ~TokenSupplierWrapper() {
+        Py_XDECREF(_pySupplier);
+    }
+
+    std::string operator()() {
+        PyGILState_STATE state = PyGILState_Ensure();
 
 Review comment:
   :+1: 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message