mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-15 23:44:49 +00:00
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:
|
while not m.connection.closed:
|
||||||
let msg = await m.connection.readMsg()
|
let msg = await m.connection.readMsg()
|
||||||
if msg.isNone:
|
if msg.isNone:
|
||||||
|
# TODO: allow poll with timeout to avoid using `sleepAsync`
|
||||||
await sleepAsync(10.millis)
|
await sleepAsync(10.millis)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user