Stream: general

Topic: Wasmtime:Retaining access to caller memory after end of call


view this post on Zulip Dylan (Apr 01 2025 at 11:40):

Hi there. I'm currently writing a WASM interface using Wasmtime wherein the host has a function that will:

  1. read message bytes from the WASM module's memory
  2. spawn a future that will:
    a. action the message represented by those bytes
    b. write some bytes to the WASM module's memory in response
    c. call a WASM export to notify the module of completion

  3. return (before the future has completed)

However the problem is that writing to memory requires a context, and we can't use the caller's context as that is only valid for the lifetime of the original host function call. What should I use instead? Thanks.


Last updated: Apr 09 2025 at 09:03 UTC