finer grained waiting

This commit is contained in:
Anton Dyudin 2018-03-09 13:56:21 -08:00
parent 4bf1f38a67
commit 8b3070b28f

View File

@ -19,7 +19,7 @@ export class Urbit
wait-silent: ~> # this feels hacky
new Promise (resolve)~>
a = set-interval ~>
if Date.now! > @last-output + 2000
if Date.now! > @last-output + 1000
clear-interval a
resolve @last-output
, 200
@ -32,8 +32,9 @@ export class Urbit
@wait-silent!then -> throw Error "Expected #re during event"
]
#
line: ->
@pty.write it
line: (s)->
<~ @wait-silent!then
@pty.write s
<~ @wait-silent!then
@stdout.write "\n"
@pty.write "\r"