[Building Sakai] Site advisor vs Observer?

Stephen Marquard stephen.marquard at uct.ac.za
Fri May 29 07:55:36 PDT 2009


Hi Chris,

Yes, that's what you'd expect. All event listeners get executed in the
request thread which posts the event. So they should be efficient, or
start their own threads.

Cheers
Stephen

Stephen Marquard, Learning Technologies Co-ordinator
Centre for Educational Technology, University of Cape Town
http://www.cet.uct.ac.za
Email/IM/XMPP: stephen.marquard at uct.ac.za 
Phone: +27-21-650-5037 Cell: +27-83-500-5290 


>>> On 2009/05/29 at 04:49 PM, "Maurer, Christopher Wayne"
<chmaurer at iupui.edu> wrote:
My understanding of the differences of the two is kind of like a before
and after approach, is that accurate?
A site advisor is consulted before the save is persisted, while the
observer is notified after the fact...does that sound right?

If that is true, then so far so good!

My next somewhat related question is that I thought that the observer
stuff would happen in a separate thread, but is seems that it
doesn’t...should it?

I ask because of some information gathered during profiling.  So, the
scenario starts with some custom code that ultimately does a
SiteService.save.  As that thing does what it does, you can see during
profiling that the save happens, then the event gets posted, the
observers pick up the event and then do whatever it is that they do. 
All the while, our operation still hasn’t “completed” because
we’re waiting on all the observers to finish up.  Is this expected
behavior?  Just curious more than anything!

Chris 


More information about the sakai-dev mailing list