extendr / extendr/extendr.github.io

Using tokio for parallelism & async

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.