Skip to content
Trigora
Start building →

Python SDK

from trigora import effect, gather, invoke, program, race, sleep, wait_for_event

effect, wait_for_event, sleep, and invoke fail if called outside an Execution. program marks the entry. It is not a durable operation.

def effect(name: str, fn: Callable[[], T]) -> T

name must be a non-empty string. fn must be callable. Details.

def wait_for_event(name: str) -> object

name must be a non-empty string. Details.

def sleep(duration: int | float | str) -> None

Details.

def invoke(name: str, *args: object) -> object

name is the child program id, the file stem. The remaining values are the ordered argument vector. Details.

def gather(*branches: object) -> object
def race(*branches: object) -> object

Each takes 1–32 direct durable calls. Details.

The Program entry is one @program async function. The program id is the file stem.