Re: [PATCH] add post-fetch hook
- From
Joey Hess <joey@kitenet.net>
- Date
- Dec 27, 2011, 15:49 UTC
- Message-ID
- <20111227154907.GB15006@gnu.kitenet.net>
- In-Reply-To
- <7v8vly8qqx.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 9 quoted lines
> Joey Hess <joey@kitenet.net> 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