locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
499 stars 131 forks source link

opcua client run on tokio runtime #286

Closed cppcoffee closed 1 year ago

cppcoffee commented 1 year ago

I use the opcua-client crate. I see that Client and Session are sync, Any suggestions on how to use them under tokio runtime?

Are opcua-client crate any plans to support async?

https://github.com/locka99/opcua/blob/master/lib/src/client/client.rs#L192

abdelhaksam commented 1 year ago

Hi, You can use tokio's task::spawn_blocking and use sync code inside.

cppcoffee commented 1 year ago

Okay, I'll use task::spawn_blocking for this.