Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can periodic hook stop rescheduling?
- X-seq: zsh-workers 39344
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Can periodic hook stop rescheduling?
- Date: Thu, 15 Sep 2016 12:18:22 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ojhPjJR+ECsvEiB7lMqnnshl4vBcRKrEw059bvhPz5o=; b=TrzYgZOcPLDz3QuIVmYGAWedRDf2l8bplM7oZsiDy4xaUVX3yQPRqKB2OcWYjpv40w yPLfSMZ80SvLD2202b4ylpEjEwy4jvskjZ05UeWqryaz03ytKwnbrqXBJMacNYl7ZMwa oPaljQd3TDjvN6DfnM0bi3Dp0W4afGJGo7MEgxkQ1IC4cvKY1IwfV5gI+vDrcC/mhpET rXe+JWTWRG+0vcfT17CanaAbOXnmW9CaP1LRwrpFzDQ351n560xg+cN6C1h8IPnswYdS eX9KhZ1fxgV6yWyFvZDPVJdWpuT5rdRvCwhUan/AssN/FiAAQJgDtjMvv8sgG7Dweew5 1Axw==
- In-reply-to: <160914215152.ZM519@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20160913085130eucas1p19723ac09c11d596542360173e4a4b308@eucas1p1.samsung.com> <CAKc7PVDkrKD_2VyvO_2JigwfvU1m=3QwO4Vac=HgHZNbOOU7pA@mail.gmail.com> <20160913142003.480cfd9c@pwslap01u.europe.root.pri> <160913091822.ZM29020@torch.brasslantern.com> <20160914200421.021c559e@ntlworld.com> <160914215152.ZM519@torch.brasslantern.com>
On 15 September 2016 at 06:51, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 14, 8:04pm, Peter Stephenson wrote:
> } Subject: Re: Can periodic hook stop rescheduling?
> }
> } On Tue, 13 Sep 2016 09:18:22 -0700
> } Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> } > The other (not mutually exclusive) option would be to make recurring
> } > schedules part of the "sched" builtin itself
> }
> } I was thinking of that and sounds like a useful feature anyway.
>
> Yes, the danger is in scheduling something harmful and for a short
> interval and then not being able to turn it off.
This might be a general topic of descheduling, its not-full
convenience. It is done via: sched -item (number of item on sched's
list as man page says). Apparently one has to fork, parse `sched`
output, establish item nr and invoke sched -item. Race condition isn't
possible because when being in function, then not being at idle
prompt, so sched won't be invoked and no deschedule will occur.
However these steps are not very convenient. Forgetting for a moment
about implementation effort, what would be the best is IMO a builtin
schedid that would put an ID (new kind, not the "item") of last
scheduled item into REPLY. No fork, no moving parts (i.e. no change of
entries' positions in the time ordered schedule list), a
hash-table-key-like ID, that a bigger script would be able to save for
use after say 2 hours when user would e.g. "unload plugin" (whatever
this means currently). As for the mistake schedule with short
interval, then maybe – that's not that best for me as schedid – new
builtin ksched, i.e. kill-sched, to deschedule all entries. I've seen
sched's code and it's really basic what's really cool, except maybe
for the around-precmd code when it get's run, I didn't see that. But a
new builtin is rather a unpleasant thing, one has to fill some
registration tables probably? What are chances for schedid, ksched,
automatic rescheduling? Maybe I could implement them when given green
light, however I first need to finish one plugin.
PS. Maybe instead of ksched – schedpop. Removes top entry from the
list. In case of problems with short interval and problematic
scheduled code, one would have to manage to enter schedpop few times,
in many cases single time.
PS2. About my question on periodic hook, is it immune to Ctrl-C?
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author