aboutsummaryrefslogtreecommitdiff
path: root/internal/worker.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-01-25 10:03:08 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-01-25 10:03:28 +0300
commit148ecf7fc398b9a82c4ac8bbc938409bbd1c55fe (patch)
treef4ceef44947f57f17da4c3ad4c68210eab537794 /internal/worker.zsh
parent45d14cbcf54a89f8985bdec49c68b0f7747eb079 (diff)
use ascii ENQ (0x05) for watchdog pings
Diffstat (limited to 'internal/worker.zsh')
-rw-r--r--internal/worker.zsh9
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/worker.zsh b/internal/worker.zsh
index 091c85f6..66ebc4d1 100644
--- a/internal/worker.zsh
+++ b/internal/worker.zsh
@@ -86,10 +86,8 @@ typeset -g _p9k__worker_file_prefix
typeset -gA _p9k__worker_request_map
typeset -ga _p9k__worker_request_queue
-# invoked in master: _p9k_worker_send_params [param]...
+# todo: remove these
function _p9k_worker_send_params() { }
-
-# invoked in master: _p9k_worker_send_functions [function-name]...
function _p9k_worker_send_functions() { }
# invoked in master: _p9k_worker_invoke <request-id> <cond> <async> <sync>
@@ -155,10 +153,9 @@ function _p9k_worker_receive() {
sysread -i $_p9k__worker_resp_fd 'buf[$#buf+1]' || return
done
- for resp in ${(ps:\x1e:)buf}; do
+ for resp in ${(ps:\x1e:)${buf//$'\x05'}}; do
local arg=$resp[2,-1]
case $resp[1] in
- p) ;;
d)
local req=$_p9k__worker_request_map[$arg]
if [[ -n $req ]]; then
@@ -229,7 +226,7 @@ function _p9k_worker_start() {
_p9k_worker_main $pgid &
{
trap '' PIPE
- while syswrite p$'\x1e'; do zselect -t 1000; done
+ while syswrite $'\x05'; do zselect -t 1000; done
kill -- -$pgid
} &
exec =true) || return