pysandbox-wasi v1.5.4
Added
- Added
Worker.call_function()for executing dynamic asynchronous function bodies against a worker's persistent globals. - Function bodies support statements,
await, andreturn. - Values are passed as explicit keyword-only arguments through the existing CBOR transport.
- Per-call fuel operations are supported through the positional
fuelargument.
result = await worker.call_function(
"""
await asyncio.sleep(1)
return add(add(a, b), add(c, d))
""",
AddFuel(500_000, cap=2_000_000),
a=1,
b=2,
c=3,
d=4,
)The source is parsed directly into an AST without indentation rewriting. The generated callable uses the worker's persistent __main__ namespace but is never inserted into its globals.
Changed
- Public
Worker.call()now rejects empty call paths. Empty paths are reserved internally forcall_function().
Full Changelog: v1.5.3...v1.5.4