extendr / extendr/extendr.github.io
Using tokio for parallelism & async
Open
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 8
- Avg merge
- 20h 26m
- Merged PRs (30d)
- 5
Description
This section covers how to utilize async functions with `tokio`.
Example use case: calling an API endpoint to get many requests in parallel.
Structure:
1. Define a response struct with serde
1. Create an async function to query the endpoint using async reqwest
2. Wrapper function to spawn many tasks in parallel second example (https://docs.rs/tokio/latest/tokio/task/fn.spawn.html#examples?)
3. create an extendr function with a runtime to evaluate the async function in a blocking context.
This can be taught in a progressive manner as individual sections
Contributor guide
Assessment
This issue has not been assessed yet.