Xiaobo Wang wrote:
> Will it be useful to provide a mechanism to notify user when hook dependency 
> changes (e.g., an event or callback)?  For the 
> filter->compression->encryption example, user may first try to register his 
> callback before compression.  But if  compression does not exist, user can 
> register his cb before encryption.  If  compression is inserted later, user 
> module can be notified and take appropriate action.

Hmmm.
In an earlier email I argued against this as it could encourage
two parties to enter a nasty loop where both take some sort of
hook ordering action when the other does (feedback loop.)
Allowing what you're suggesting above is handing out some rope
to do just that.  I suppose the question is should we make the
rope available and just berate those that hang themselves or
not make it available at all?

The question that needs to be asked is if this isn't present,
is the rest of what is available complete?  I don't see it as
being something compelling but I'm just one person.


> Another thought is to add an option IMMEDIATELY_BEFORE v.s. just BEFORE.  For 
> the above example, user can register his callback as BEFORE encryption if 
> compression does not exist.  If later compression is inserted as 
> IMMEDIATELY_BEFORE encryption, then user's callback dependency is still valid 
> since it does not mind whether it is immediately or several callbacks before 
> encryption callback.   It is even possible that if user choose to insert his 
> callback just BEFORE encryption, and compression has been inserted as 
> IMMEDIATELY_BEFORE encryption, then the HOOKAPI can automatically adjust the 
> insertion point to before compression - this satisfies user requirement 
> without breaking existing dependencies......

I think rather than call them "IMMEDIATELY_BEFORE" and "_AFTER",
I'd be tempted to use the words "NEXT" and "PREVIOUS."

Darren

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to