ecodina commented on issue #28647:
URL: https://github.com/apache/airflow/issues/28647#issuecomment-1649670124

   Sure, this is the minimum possible example. We do many more things, but with 
this it should work. I also see you're using kubernetes. We installed it using 
pip.
   
   ```
   class MyOperator(BaseOperator):
       # ...
   
       def execute(self, context):
           # Do a few things
           self.defer(trigger=MyTrigger(), method_name="trigger_finished")
   
       def trigger_finished(self, context, event=None):
           # Do something
   
   
   class MyTrigger(BaseTrigger):
       # ...
   
       async def run(self):
           # We monitor a logfile (external to Airflow), reading it with 
aiofiles
           # new_lines is the variable containing the new lines from this 
logfile, which will be printed on Ariflow's log
   
           for l in new_lines:
               self.log.info(l)
   ```


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