Skip to content
PACKAGES

Recipes

Recipes describe Python-specific composition around the clean-slate graph facade. Cross-language protocol guarantees stay in the shared docs; exact Python syntax stays here.

Async work belongs at package-owned source and adapter boundaries. Python callers provide the runtime runner explicitly:

from graphrefly import Graph, from_awaitable, asyncio_runner
async def load_value() -> int:
return 7
graph = Graph("runner")
node = from_awaitable(graph, asyncio_runner(), load_value, name="value")

When host-owned work completes away from the graph owner thread, use the graph-owned re-entry queue. It is not a public graph mutation channel; it only drains GraphReFly-owned completions.

queue = graph.reentry_queue()
runner = queue.wrap_runner(host_owned_runner)