martinzink commented on code in PR #2186:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2186#discussion_r3339499756
##########
minifi_rust/minifi_native/src/api/processor_wrappers/complex_processor.rs:
##########
@@ -0,0 +1,94 @@
+use crate::api::processor::{AdvancedProcessorFeatures, CalculateMetrics};
+use crate::api::raw_processor::{MultiThreadedTrigger, SingleThreadedTrigger};
+use crate::{
+ ComponentIdentifier, Concurrent, Exclusive, Logger, MinifiError,
OnTriggerResult,
+ ProcessContext, ProcessSession, Processor, ProcessorDefinition, Schedule,
+};
+
+pub trait MutTrigger {
+ fn trigger<Ctx, Session, Lggr>(
+ &mut self,
+ context: &mut Ctx,
+ session: &mut Session,
+ logger: &Lggr,
+ ) -> Result<OnTriggerResult, MinifiError>
+ where
+ Ctx: ProcessContext,
+ Session: ProcessSession<FlowFile = Ctx::FlowFile>,
+ Lggr: Logger;
+}
+
+pub trait Trigger {
+ fn trigger<Context, Session, Lggr>(
+ &self,
+ context: &mut Context,
+ session: &mut Session,
+ logger: &Lggr,
+ ) -> Result<OnTriggerResult, MinifiError>
+ where
+ Context: ProcessContext,
+ Session: ProcessSession<FlowFile = Context::FlowFile>,
+ Lggr: Logger;
+}
+
+pub struct ComplexProcessorType {}
+
+impl<Implementation, L> SingleThreadedTrigger
+ for Processor<Implementation, ComplexProcessorType, Exclusive, L>
+where
+ Implementation: Schedule
+ + MutTrigger
+ + ComponentIdentifier
+ + ProcessorDefinition
+ + CalculateMetrics
+ + AdvancedProcessorFeatures,
Review Comment:
For a struct to be able to be registered as a single threaded
ComplexProcessorType it needs to implement these traits
--
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]