Crash-resistant Python code made easy


License
GPL-3.0
Install
pip install txlog==2.2308.0

Documentation

txlog

Crash-resistant Python code made easy

Usage

from txlog import TxLog, Call
self.txlog = TxLog('./txlog')

Script

def secure_function(a, b):
    print(f'{a}, {b}')
    
txlog.begin()
txlog.add(Call('secure_function', ['input1', 'input2']))
txlog.commit()

txlog.exec_uncommitted_calls()

Instance

class Instance:
  
  def __init__(self):
    txlog.begin()
    txlog.add(Call('secure_method', ['input1', 'input2']))
    txlog.commit()
    instance.txlog.exec_uncommitted_calls(self)

  def secure_method(self, a, b):
      print(f'{a}, {b}')

instance = Instance()