At AutoKitteh, we run users’ Python code as-is in a way that can redo parts of the execution in case of failures.
This article explains the magic.
In a nutshell, AutoKitteh uses Temporal to run the user code. It takes the user code and converts functions, such as ml.enrich, into temporal activities. The user code changes function call from event = ml.enrich(event) to event = _ak_call(ml.encrich, event) Where _ak_call does the following:
This magic is implemented by AST rewriting.
For more information, read the article.
The above is the detailed content of Hacking the Python Import System and Rewriting the AST For Durable Execution. For more information, please follow other related articles on the PHP Chinese website!