Currently I allow components to make host calls for stuff like registrations/logging/etc. I am wondering if there is some way for the host to know which component is making the call so that I can do things like mapping the registration to the correct component. Let me know if you would like to see some examples of what I mean if necessary.
this came up in a conversation in our team just yesterday as well.
One question: do you need to know which component type the call came from, or which component instance? In our case the latter is important, as the same component type could be instantiated multiple times, and with different sets of configuration
Yes it's indeed the instance I want to be able to differentiate on. If I understand it correctly they're all the same type anyways (instantiate them with Plugin::instantiate_async, where Plugin is a wit-bindgen generated type).
the type would still be different per specific component, even if the implemented interfaces are the same. The difference is mostly relevant for component graphs, where a nested component could make a call instead of the top-level one, I guess
We have been working on some changes to Wasmtime to allow this that were briefly discussed here earlier this month. But this is still at the "interesting [to me] academic project" stage rather than something that might be upstreamed as-is. I wasn't able to see a good way of doing it with stock Wasmtime unfortunately.
Last updated: Dec 06 2025 at 06:05 UTC