Using a Tokio based RPC lib with async-std

Hi there,

I want to use one of the RPC libs but they are all based on tokio AFAICS. However, my app depends on async-std due to the excellent https://github.com/prisma/tiberius (MSSQL) and https://github.com/http-rs/tide (web).

Switching to a pure Tokio-supported stack is prohibitive (as the old tokio based MSSQL lib https://github.com/steffengy/tiberius is no longer supported).

Is there a general guidance resource for using both async-std and tokio runtimes together anywhere?

Thanks!

From the documentation of async-std:

Compatibility with the tokio runtime is possible using the tokio02 Cargo feature:

[dependencies.async-std]
version = "1.6.5"
features = ["tokio02"]

link

1 Like

things move so quickly in rust land :-). Thanks @alice

You're welcome. Note that the Cargo.toml for prisma tiberius contains both async-std and Tokio as optional dependencies, so I suspect that only tide is forcing you to use async-std.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.