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, InvokerClient
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)
client: InvokerClient = ... # any valid invoker client, mostly PolywrapClient
message = "hey"
args = {"arg": message}
result = wrapper.invoke(
uri=Uri.from_str("fs/./build"),
method="simpleMethod",
args=args,
client=client
)
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.0a34.tar.gz
(13.0 kB
view hashes)
Built Distribution
Close
Hashes for polywrap_wasm-0.1.0a34-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62bac12a9b7733f77efe99b22a00b47250a6f45fd00e67f0560da2cbb0e2fa40 |
|
MD5 | be9daf74bc598bef67a6d17747b5c0a2 |
|
BLAKE2b-256 | e2cfd4be4882c8cfa1f2570d28250c8460bca1544004deed4fd0ab3828d40d72 |