Johan B.W. de Vries 34aaaa4ccb Routing ideas
2023-04-10 14:12:50 +02:00

35 lines
734 B
Python

import sys
from phasmplatform.common.config import from_toml
from phasmplatform.common.router import StdOutRouter
from .runners.base import BaseRunner
from .runners.wasmtime import WasmTimeRunner
def main() -> int:
with open('config.toml', 'rb') as fil:
config = from_toml(fil)
del config
stdout_router = StdOutRouter()
foo: BaseRunner
with open('/home/johan/projects/idea/phasm/examples/crc32.wasm', 'rb') as fil:
foo = WasmTimeRunner(stdout_router, fil.read())
namespace = b'test-namespace'
topic = b'test-topic'
kind = b'test-kind'
body = b'test-body'
foo.handle_message(namespace, topic, kind, body)
return 0
if __name__ == '__main__':
sys.exit(main())