Hi Thomas,

On Jul 12, 2011, at 6:09 PM, Thomas Mortagne wrote:

> Hi devs,
> 
> I would like to introduced a standardized (at observation API level)
> way to indicate that en event represent the beginning or the end of
> something. The idea is them to use it in things like activity stream
> to group events/whatever

Yes, I'd like that too (we talked about it offline actually ;)) so that we can 
have higher level events wrapping smaller ones. For example a Rename event 
wrapping the Copy + Delete events and showing up as a Rename event in the 
Activity Stream (with the possibility to expand it to show enclosed events). 
The same could be done for a XAR import: a high level XAR Import event wrapping 
all Doc creation/update events so that it doesn't "pollute" the Activity 
Stream. We can imagine lots of Application-level events like this.

> or in my case maintain a stack of states in
> the Execution context about the current action updated by listening to
> events.
> 
> My immediate use case is to filter some modification in automatic
> watch feature (imported xar, crated wikis, etc.) but I feel that we
> need that information for a larger audience.

Yep definitely.

Note that this change will mean the following changes too in the future:
* Modify the Activity Stream to handle beginning/end events and nested events

> In details my proposal is to introduce BeginEvent and EndEvent
> interface (feel free to suggest better names if you have some in
> mind). Then pushing the BeginEvent instance in the context in a stack
> of current events poped when receiving a EndEvent.

context = Execution Context 

One thing to be careful of is that we'll need to use try/finally block wherever 
we send these events to be sure the EndEvent is always sent as otherwise it'll 
lead to "stack corruption".

> Note that I don't not plan to put an id in Begin/EndEvent since it
> should not be needed if they are properly generated (some job can't
> finish if all it's sub jobs are not finished).
> 
> WDYT ?

+1

Thanks
-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to