lordgamez commented on code in PR #2135:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2135#discussion_r3180416826


##########
extensions/python/tests/features/resources/SingleThreadedSleepForever.py:
##########
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import time
+from nifiapi.flowfilesource import FlowFileSource
+from nifiapi.processorutils import trigger_serially
+
+
+@trigger_serially
+class SingleThreadedSleepForever(FlowFileSource):
+    class Java:
+        implements = ['org.apache.nifi.python.processor.FlowFileSource']
+
+    class ProcessorDetails:
+        version = '2.0.0-snapshot'
+        description = '''Test Python source processor.'''
+        tags = ['text', 'test', 'python', 'source']

Review Comment:
   Updated to "NiFi-style" python processor in the description to avoid stating 
that it should be compatible in 
https://github.com/apache/nifi-minifi-cpp/pull/2135/commits/6b11275afa0753c91c841ae4310a48b882a48565



##########
extensions/python/tests/features/resources/SleepForever.py:
##########
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import time
+from nifiapi.flowfilesource import FlowFileSource
+
+
+class SleepForever(FlowFileSource):
+    class Java:
+        implements = ['org.apache.nifi.python.processor.FlowFileSource']
+
+    class ProcessorDetails:
+        version = '2.0.0-snapshot'
+        description = '''Test Python source processor.'''
+        tags = ['text', 'test', 'python', 'source']

Review Comment:
   Updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2135/commits/6b11275afa0753c91c841ae4310a48b882a48565



##########
extensions/python/PYTHON.md:
##########
@@ -222,6 +222,13 @@ class VaderSentiment(object):
     return len(self.content)
 ```
 
+By default the MiNiFi C++ style native python processors are executed with 
multiple threads in parallel, but it is possible to set the processor to be 
single threaded by calling the `setSingleThreaded()` method in the processor 
while initializing. When a processor is set to be single threaded, only one 
thread will execute the processor, and setting the max concurrent tasks to more 
than 1 in the flow configuration will not have any effect.

Review Comment:
   Updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2135/commits/6b11275afa0753c91c841ae4310a48b882a48565



##########
extensions/python/pythonprocessors/nifiapi/decorators.py:
##########


Review Comment:
   Good point, updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2135/commits/6b11275afa0753c91c841ae4310a48b882a48565



-- 
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