Skip to content

v1.5.4

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Aug 02:51
030cf6f

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, and return.
  • Values are passed as explicit keyword-only arguments through the existing CBOR transport.
  • Per-call fuel operations are supported through the positional fuel argument.
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 for call_function().

Full Changelog: v1.5.3...v1.5.4