Async task examples
The engine's async task examples: what each one shows, whether it runs in a browser and the command that runs it.
Running work on the task pools and getting the results back into the world. There are 3 examples on this page. For the concepts behind them, see Tasks.
Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.
Examples#
| Example | What it shows | Web | Run |
|---|---|---|---|
| Async Channel Pattern | An example showing how to offload work to background async tasks using channels for communication. | Yes | cargo run --example async_channel_pattern |
| Async Compute | How to use AsyncComputeTaskPool to complete longer running tasks | No | cargo run --example async_compute |
| External Source of Data on an External Thread | How to use an external thread to run an infinite task and communicate with a channel | No | cargo run --example external_source_external_thread |