-
I've been trying to make the throttle block a wasm-compatible. However, that was not successful yet. There is already a wasm-compatible async sleep used in the flowgraph here FutureSDR/src/runtime/flowgraph.rs Line 217 in faef89b Send and can therefore not be used in here FutureSDR/src/blocks/throttle.rs Line 98 in faef89b Any ideas how to make this work? I am trying to just get some artificially generated data out of the flowgraph in wasm, but data seems to never reach the sink unless throttled. It does work when I compile it for linux. Once I get that running I would like to also make the websocket sink wasm compatible using tokio-tungstenite-wasm. Working on a small demo that uses the slint GUI framework for plotting FutureSDR data. It works quite nicely when running slint in the browser and FutureSDR streaming the data from the "desktop" binary via websockets. But I'd like to have it self-contained in a single wasm application. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 16 replies
-
I tried to add it but have no real test case at the moment, could you checkout the most recent commit? At the moment, the wasm stuff is all single-threaded (i.e., non-Send) but can be spawned in a WebWorker. The |
Beta Was this translation helpful? Give feedback.
-
Regarding your issue that something doesn't reach a block, that's often related to buffer history. A native block uses the circular buffer, where this is no issue. On wasm we use the slab buffer, which might need manual history/overlap configuration. See for example: https://github.com/FutureSDR/FutureSDR/blob/main/examples/zigbee/src/wasm_worker.rs#L100 |
Beta Was this translation helpful? Give feedback.
I tried to add it but have no real test case at the moment, could you checkout the most recent commit?
At the moment, the wasm stuff is all single-threaded (i.e., non-Send) but can be spawned in a WebWorker. The
block_on
function was missing the compile switch, which should be added now. Extending also the wasm stuff to multi-threaded would be possible but that's quite a bit of work and one needs to dive in to shared array buffers.