lordgamez commented on a change in pull request #1232:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1232#discussion_r781179483



##########
File path: extensions/script/ExecuteScript.h
##########
@@ -28,17 +28,95 @@
 
 #include "ScriptEngine.h"
 #include "ScriptProcessContext.h"
+#include "utils/Enum.h"
 
 namespace org {
 namespace apache {
 namespace nifi {
 namespace minifi {
+
+#ifdef PYTHON_SUPPORT
+namespace python {
+class PythonScriptEngine;
+}
+#endif  // PYTHON_SUPPORT
+
 namespace processors {
 
+class ScriptEngineFactory {
+ public:
+  ScriptEngineFactory(core::Relationship& success, core::Relationship& 
failure, std::shared_ptr<core::logging::Logger> logger);
+
+  template<typename T>
+  std::shared_ptr<T> createEngine() const {
+    auto engine = std::make_shared<T>();
+
+    engine->bind("log", logger_);
+    engine->bind("REL_SUCCESS", success_);
+    engine->bind("REL_FAILURE", failure_);
+
+    return engine;
+  }
+
+ private:
+  core::Relationship& success_;
+  core::Relationship& failure_;
+  std::shared_ptr<core::logging::Logger> logger_;
+};
+
+class ScriptEngineQueue {
+ public:
+  ScriptEngineQueue(uint8_t max_engine_count, ScriptEngineFactory& 
engine_factory, std::shared_ptr<core::logging::Logger> logger);
+
+  template<typename T>
+  std::shared_ptr<script::ScriptEngine> getScriptEngine() {

Review comment:
       Good point, there is no point of having different types of script 
engines in a queue. Added a class level template parameter for the engine type 
and similar type restriction to `createEngine` in 
e1583ef65af13edcd0d5b07da6eee5ea84ba3cbd




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to