Feature request: async gloo worker example
Summary
Current gloo worker examples are all synchronous. It would be good to provide an example of using it in as async friendly way as possible. It maybe that we need to adapt the current gloo worker design to be more async friendly (passing worker scope around could be problematic for being able to return messages back from inside async functions?).
Motivation
If people want to use async then this example will make it easier for them to get started and will show them a good path. Otherwise people will fumble in the dark and it will take them a long time.
Detailed Explanation
I don't know how this would look like alas... is there any prior art / examples that we can look at?
Unresolved Questions
Ideally dodge having to make an async runtime choice - just pick one in the example.
E.g. I'm assuming that in a worker received fn, it's probably not a great idea to do async_std::task::block_on( to kick off being async...
You should be able to use WorkerScope::send_future to spawn a task.
passing worker scope around could be problematic.
You can choose to return a message for send_future and send back output in fn update() lifecycle event or clone WorkerScope to respond to bridges directly in the future.
You can clone worker scope? Ok that makes life easier!!!