Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing Tokio's TcpStream with async-std TcpStream #475

Merged
merged 13 commits into from
Jan 30, 2024
119 changes: 119 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions clients/stellar-relay-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ err-derive = "0.3.1"
tokio = { version = "1.0", features = [
"macros", # allows main function to be async
"rt-multi-thread", # for multi-thread runtime
"net", # contains the TcpStream
"sync", # to make channels available
"io-util", # for async read/write operations
"time" # for timeouts and sleep, when reconnecting
] }
async-std = { version = "1.12.0", features = ["attributes"] }

[features]
std = [
Expand Down
2 changes: 1 addition & 1 deletion clients/stellar-relay-lib/examples/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let mut overlay_connection = connect_to_stellar_overlay_network(cfg, &secret_key).await?;

while let Ok(Some(msg)) = overlay_connection.listen().await {
while let Ok(Some(msg)) = overlay_connection.listen() {
match msg {
StellarMessage::ScpMessage(msg) => {
let node_id = msg.statement.node_id.to_encoding();
Expand Down
Loading
Loading