Skip to content

Help with async FFI library #3534

Answered by Darksonn
guilhermewerner asked this question in Q&A
Discussion options

You must be logged in to vote

There are many different answers to this question depending on how the non-Rust code needs to talk with the Rust code. The simplest way is to simply create a tokio::runtime::Runtime object, and use its block_on method to transfer into an async region. By reusing the Runtime object, you avoid creation of many new runtimes.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@guilhermewerner
Comment options

@Darksonn
Comment options

@guilhermewerner
Comment options

Answer selected by guilhermewerner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants