bltavares / colmeia

Attempt to make an interop layer to connect to dat on hyperswarm in Rust
24 stars 4 forks source link

Avoid locking on read from network #29

Open bltavares opened 3 years ago

bltavares commented 3 years ago

Some places have self.stream_on_network.write().next().await which may lead to locking the stream for a long time.

Some places use .timeout from async-std to avoid locking it for too long, but the timeout is arbitrary. Instead, it would be better to use .now_or_never() from future crate.

This would make it easier to use also make the executor abstract on #25