Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wit-component: Reactors should call _initialize #1464

Open
ospencer opened this issue Mar 20, 2024 · 2 comments
Open

wit-component: Reactors should call _initialize #1464

ospencer opened this issue Mar 20, 2024 · 2 comments

Comments

@ospencer
Copy link
Member

When using wasm-tools component new with --adapt pointed to a reactor adapter, it'd be great if _initialize was called in the resulting component, maybe via (start).

Currently, there's no way to access and call _initialize unless you specify it in a wit file, but that feels odd.

@alexcrichton
Copy link
Member

One of the main difficulties of _initialize-vs-(start) is that _initialize is separate from (start) to ensure that it's only invoked once all imports to the module are "ready". For components, for example, imports aren't ready when (start) is invoked meaning that we wouldn't be able to put _initialize there. That being said we could perhaps synthesize a second module which imports _initialize and is instantiated after all imports are "ready", and I think that'd be a reasonable change to make.

@ospencer
Copy link
Member Author

My apologies, I thought there was a component-level (start) as opposed to core wasm's, but I might have been mistaken. What I was hoping for is exactly what you mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants