No project description provided
Project description
polywrap-wasm
Python implementation of the Wasm wrapper runtime.
Usage
Invoke Wasm Wrapper
from typing import cast
from polywrap_manifest import AnyWrapManifest
from polywrap_core import FileReader, Invoker
from polywrap_wasm import WasmWrapper
file_reader: FileReader = ... # any valid file_reader, pass NotImplemented for mocking
wasm_module: bytes = bytes("<wrapper wasm module bytes read from file or http>")
wrap_manifest: AnyWrapManifest = ...
wrapper = WasmWrapper(file_reader, wasm_module, wrap_manifest)
invoker: Invoker = ... # any valid invoker, mostly PolywrapClient
message = "hey"
args = {"arg": message}
options: InvokeOptions[UriPackageOrWrapper] = InvokeOptions(
uri=Uri.from_str("fs/./build"), method="simpleMethod", args=args
)
result = await wrapper.invoke(options, invoker)
assert result.encoded is True
assert msgpack_decode(cast(bytes, result.result)) == message
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
polywrap_wasm-0.1.0a19.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for polywrap_wasm-0.1.0a19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c143d8b9bac2d2a776785faa58ace425ef8adaaa7659ee08e516e728b15290 |
|
MD5 | b980d05629916dea71f63844aa996657 |
|
BLAKE2b-256 | be93b9d5c8425b4767abea5a0067484df615dcffc44755fc49a2f7f8abbdd87c |