-
Notifications
You must be signed in to change notification settings - Fork 256
Description
in issue #1440 a feature was added to allow tasks to wakeup other tasks. This basically means that you can start a long running task via channels and have that work resume with later entries (which are different tasks).
For anyone who is trying to use inter-task-wakeup working at the time of this post you've probably run into an annoying issue trying to get it to work because there are some upstream changes that have not found their way downstream. So here is your current best workaround.
- You can't use wasm32-wasip2 target, it will fail because it embeds an old version of wasm-component-ld. So you have to use wasm-tools directly with the wasi_snapshot_preview1.reactor adapter. (make sure you have the latest versions)
Caused by:
0: failed to decode world from module
1: module was not valid
2: failed to resolve import $root::[async-lower][stream-read-unit]
3: no top-level imported function [async-lower][stream-read-unit] specified
- You have to specifically mark these function as async if you are using wasmtime, otherwise you will get a trap about blocking in synchronous tasks. This one is undoubtedly a bug related to incomplete implementation of async-component model in wasmtime. So you will just need to the run_concurrent api on wasmtimes store and work with store accessor bindings.
Hopefully this helps people wanting to experiment with the feature now, while the ecosystem settles.