mirror of https://github.com/vacp2p/nim-libp2p.git
todo: poll should allow for timeouts
This commit is contained in:
parent
cfd31c5251
commit
f9a04dbb9d
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue