From b8b5f00e9695f46ea30af3ce63aec6dd17f356ae Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 27 Jun 2024 02:39:31 +0200 Subject: Improve async channels error handling and replace unbounded channels with bounded channels Remove all unbounded channels to prevent unbounded memory usage and potential crashes. Use `FuturesUnordered` for sending to multiple channels simultaneously. This prevents the sending loop from blocking if one channel is blocked, and helps handle errors properly. --- core/Cargo.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/Cargo.toml') diff --git a/core/Cargo.toml b/core/Cargo.toml index d30b956..895ddf6 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -10,9 +10,9 @@ authors.workspace = true [features] default = ["smol"] -crypto = ["dep:ed25519-dalek"] +crypto = ["ed25519-dalek"] tokio = ["dep:tokio"] -smol = ["dep:smol", "dep:async-process"] +smol = ["dep:smol", "async-process"] [dependencies] log = "0.4.21" @@ -29,6 +29,9 @@ pin-project-lite = "0.2.14" async-process = { version = "2.2.3", optional = true } smol = { version = "2.0.0", optional = true } tokio = { version = "1.38.0", features = ["full"], optional = true } +futures-util = { version = "0.3.5", features = [ + "alloc", +], default-features = false } # encode bincode = "2.0.0-rc.3" -- cgit v1.2.3