mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
finer grained waiting
This commit is contained in:
parent
4bf1f38a67
commit
8b3070b28f
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user