Open schitcrafter opened 11 months ago
Kinda unrelated but I just wanna mention that there's not a lot of documentation on how to use async with evcxr - I'd find it very good to have some info on what I need to do/what is done automatically
Thanks for the bug reports! I've pushed fixes for those issues. I had some documentation the sample notebook for the jupyter kernel, but that's a super-not-obvious place to look. I took those docs and adapted / updated them and put them in COMMON.md.
Description
When there is no tokio dependency specified, but async code is in use, evcxr automatically adds
tokio = "1.20.1"
to the generated Cargo.toml. In the generated lib.rs, a new tokio runtime is then created, usingtokio::runtime::Runtime::new(..)
- this method, however, is only available on the "rt-multi-thread" feature (see here). Trying to execute this (in my case, inside a jupyter notebook) leads to a strange error:Possible solutions
Automatically add the "rt-multi-thread" or "full" feature when generating Cargo.toml
Local Setup
evcxr v0.16.0, rust 1.74.0, Windows 11