Home > Backend Development > Python Tutorial > Hacking the Python Import System and Rewriting the AST For Durable Execution

Hacking the Python Import System and Rewriting the AST For Durable Execution

Patricia Arquette
Release: 2024-12-19 08:33:09
Original
468 people have browsed it

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:

Hacking the Python Import System and Rewriting the AST For Durable Execution

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!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template