todo: poll should allow for timeouts

This commit is contained in:
Dmitriy Ryajov 2019-10-02 15:49:01 -06:00
parent cfd31c5251
commit f9a04dbb9d
1 changed files with 1 additions and 0 deletions

View File

@ -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