From f9a04dbb9dfdd3ffd21b4597a1fec2067abf29e5 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 2 Oct 2019 15:49:01 -0600 Subject: [PATCH] todo: poll should allow for timeouts --- libp2p/muxers/mplex/mplex.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index eae4bd72a..a86c8be80 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -57,6 +57,7 @@ method handle*(m: Mplex) {.async, gcsafe.} = while not m.connection.closed: let msg = await m.connection.readMsg() if msg.isNone: + # TODO: allow poll with timeout to avoid using `sleepAsync` await sleepAsync(10.millis) continue