def __call__(self, **kwargs) -> None: """ Call first step of pipeline with kwargs as input data. It's important to compile pipeline before calling it. :param kwargs: input data for pipeline :return: Result of pipeline used only for testing purpose. And everything configure in a special way for that. In all other cases result will be None. """ if not self.pipeline: raise RuntimeError("Seems like pipeline not build yet, call " "Pipeline.compile() first") if not self.pipeline.is_compiled(): raise RuntimeError("Worker pipeline no compiled, " "run worker.compile()") for callback in self.before_callbacks: callback(**kwargs) result = call_next_step(kwargs, self.pipeline.get_stepist_root()) for callback in self.after_callbacks: callback(**kwargs) if result: # only for testing. Not supported for production, yet. return list(result.values())[0]
def __call__(self, **kwargs): handler_data = validate_handler_data(self.handler, kwargs) result = self.handler(**handler_data) call_next_step(result, self.step)
def add_job(self, data): call_next_step(data, self.step)
def _job_to_stepist(self, stepist_job, step, **kwargs): call_next_step(stepist_job, step, **kwargs)
def send_job_to_producer(self, stepist_job): call_next_step(stepist_job, self.producer.stepist_step)
def __call__(self, **data): flow_result = call_next_step(data, self.step) return flow_result