I’m just starting to learn Rust, and was wondering if there is a good way to do coroutines/channels. I’ve grown fond of languages based around CSP, but am not sure that maps well to idiomatic Rust.

Thanks in advance!

  • runiq@lemmyrs.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Someone please correct me because I’m fairly sure I’m not entirely correct here, but IIRC from the ‘Programming Lua’ book, (symmetric) coroutines allow you to pass data back into the routine at the await point. Or, in Lua parlance, coroutine.resume() can take arguments.