monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Hooks...


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Hooks...
Date: Wed, 5 Sep 2007 07:20:01 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

On Wed, Sep 05, 2007 at 02:47:52PM +0200, Richard Levitte wrote:
> We need to think a few steps further, me thinks:
> 
> - What do we do with the values returned by the hook functions,
>   especially if one event has more than one hook function registered?
> - Do we want to make it possible to give a priority to hook functions?
>   That would require a priority parameter to add_hook().
> - Do we want a third function that returns information about a hook,
>   such as how many functions are attached and their identities (the id
>   returned by add_hook()), and whatever other data there may be.
> - Do we want to be able to identify some hook functions by name?

How can we answer any of these without first thinking about use cases?
I mean, obviously we could just make up a bunch of machinery with lots
of shiny dials and moving parts and then look at it admiringly from
time to time, but presumably the goal is to solve real problems :-).

The one that comes to my mind is "I want netsync hooks called for my
CIA notifier *and* my commit mail notifier".  This is pretty easy now,
just define a hook that calls the others, but anyway, if we wanted
more formal machinery for that, then obviously what it would be was a
way to register a list of netsync notifier hooks, which are called in
some arbitrary order whenever the relevant event occurred, with return
values and errors ignored, and no need for any other fancy stuff.

Maybe there are other use cases too that I'm not thinking of, they
might have other requirements.

-- Nathaniel

-- 
So let us espouse a less contested notion of truth and falsehood, even
if it is philosophically debatable (if we listen to philosophers, we
must debate everything, and there would be no end to the discussion).
  -- Serendipities, Umberto Eco




reply via email to

[Prev in Thread] Current Thread [Next in Thread]