zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Can periodic hook stop rescheduling?
Date: Tue, 13 Sep 2016 10:49:35 +0200	[thread overview]
Message-ID: <CAKc7PVDkrKD_2VyvO_2JigwfvU1m=3QwO4Vac=HgHZNbOOU7pA@mail.gmail.com> (raw)

Hello,
I'm using sched to call a function. The problem is, it sometimes
doesn't reschedule. sched +2 is the first line of the scheduled
function, however I observed, that when running a completion and
pressing Ctrl-C to abort something in it (when using
:completion:*:*:*:default' menu yes select search) this Ctrl-C might
somehow apparently reach scheduled function and block reschedule. I've
added a protection via preexec hook – I check when scheduled function
did last run and reschedule when a delay is detected.

I thought about adding such protection via periodic hook. The question
is: is it fully robust? Doc says that error in precmd will stop
periodic function, however it isn't clear about next expected run of
it:

"Note further that an error in a precmd hook causes an immediately
following periodic function not to run (though it may run at the next
opportunity). "

So, is the reschedule of periodic fully robust, or is it possible that
error in precmd (and maybe Ctrl-C press) will block reschedule?
(blocking single run is fine)

Best regards,
Sebastian Gniazdowski


             reply	other threads:[~2016-09-13  8:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160913085130eucas1p19723ac09c11d596542360173e4a4b308@eucas1p1.samsung.com>
2016-09-13  8:49 ` Sebastian Gniazdowski [this message]
2016-09-13 13:20   ` Peter Stephenson
2016-09-13 13:34     ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVDkrKD_2VyvO_2JigwfvU1m=3QwO4Vac=HgHZNbOOU7pA@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).