Subject: Re: [PATCH] add post-fetch hook

From: Joey Hess <[email-masked]>
Date: Tue, 27 Dec 2011 11:49:07 -0400

Junio C Hamano wrote:
> Joey Hess <[email-masked]> writes:
> 
> > .... And other code in git uses an async feeder similarly,
> > see for example convert.c's apply_filter(). So I think this is ok..?
> 
> Yeah, I didn't look at your patch (sorry) but if it uses async like the
> filtering codepath does, it should be perfectly fine (please forget about
> the select(2) based kludge I alluded to; the async interface is the right
> thing to use here).

No problem, I was surprised to be getting responses at all over the
holidays. :)

Then async also seems the right thing to use for the hook refactoring. A
caller can provide two function pointers; a feeder function that is
called async, and a reader that is *not* called async (which would allow
it to modify program state), and the refactored hook function handles
running the hook(s) and connecting them to the feeder and/or reader.

-- 
see shy jo