35 lines
737 B
Python
35 lines
737 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/platform.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())
|