You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if I was missing the obvious, but from the documentation and examples alone I was not immediately able to figure out how to actually put all the bits and pieces together in order to get a working setup of a main application that is being loaded via index.html and which then spawns a worker via Rust and communicates with it.
The part that kept confusing me most was, that for instance in the prime example the worker code seemed to reside in the same source file as the function that spawns it and it took me a while to figure out, that the function marked as #[reactor] apparently needs to be shared between both the code that does the spawning and the code that is representing the worker.
Further, I was and actually still am totally confused about the interaction of the buttons in the prime example html and the Rust code, my targeted use case was anyway much simpler. In the end I was able to get something working that provided the setup that I needed: https://github.com/jin-eld/gloo-worker-example
Can't say if I implemented everything in a way it was meant to be used from the gloo API perspective, I am also new to Rust, but it works; comments on that are welcome. Please let me know f you are interested in the above example, if yes, then I'd be willing to implement it in a pull request, otherwise I'll just leave the repo around in case someone else has a hard time to get started.
The text was updated successfully, but these errors were encountered:
Using @jin-eld example is the only way I have found to make the gloo worker work. However, it's really different from the simple example found in the documentation, for instance here:
The gloo examples are to be used with trunk, which is the defacto build tool for rust/wasm frontend frameworks. The index.html is read by trunk. I think we should clarify that, perhaps even add a readme for examples.
Hi,
I don't know if I was missing the obvious, but from the documentation and examples alone I was not immediately able to figure out how to actually put all the bits and pieces together in order to get a working setup of a main application that is being loaded via
index.html
and which then spawns a worker via Rust and communicates with it.The part that kept confusing me most was, that for instance in the
prime
example the worker code seemed to reside in the same source file as the function that spawns it and it took me a while to figure out, that the function marked as#[reactor]
apparently needs to be shared between both the code that does the spawning and the code that is representing the worker.Further, I was and actually still am totally confused about the interaction of the buttons in the
prime
example html and the Rust code, my targeted use case was anyway much simpler. In the end I was able to get something working that provided the setup that I needed: https://github.com/jin-eld/gloo-worker-exampleCan't say if I implemented everything in a way it was meant to be used from the gloo API perspective, I am also new to Rust, but it works; comments on that are welcome. Please let me know f you are interested in the above example, if yes, then I'd be willing to implement it in a pull request, otherwise I'll just leave the repo around in case someone else has a hard time to get started.
The text was updated successfully, but these errors were encountered: