optimize worker i/o

This commit is contained in:
romkatv 2020-02-22 18:19:28 +01:00
parent 0c606eb9e9
commit 0a28653355
1 changed files with 6 additions and 3 deletions

View File

@ -50,9 +50,12 @@ function _p9k_worker_main() {
else
local REPLY=
while true; do
sysread -i $fd 'REPLY[$#REPLY+1]' && continue
(( $? == 5 )) || return
break
if sysread -i $fd 'REPLY[$#REPLY+1]'; then
[[ $REPLY == *$'\x1e' ]] || continue
else
(( $? == 5 )) || return
break
fi
done
local cb=$_p9k_worker_fds[$fd]
_p9k_worker_request_id=${cb%%$'\x1f'*}