ListEventPublisher event notification order

View: New views
2 Messages — Rating Filter:   Alert me  

ListEventPublisher event notification order

by Compulinkltd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was looking at this documentation:

http://publicobject.com/glazedlists/documentation/ListEventPublisher.pdf

What is the actual algorithm that GL uses to determine a correct update
sequence?  Are you building a directed acyclic graph (DAG) of the
dependencies and doing a topological sort?

Bruce

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


re: ListEventPublisher event notification order

by Kevin Day-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Bruce-
 
Take a look at the invariant described in the javadocs of SequenceDependenciesEventPublisher#orderSubjectsAndListeners
Specifically:
 

* Rebuild the subject and listeners list so that all required invariants

* are met with respect to notification order. That is, for any listener

* T, all of the subjects S that T listens to have been updated before T

* receives a change event from any S.

 
 
It's amazing how something that simply written is so insanely hard to get one's head around (at least for me - but it's been awhile since I was in school, so maybe that's just age working against me).  Basically the current publisher maintains an ordered list, with the ordering meeting the described invariant.  I'm pretty sure that the end result is the same as a DAG, but the ordering of event notifications is much faster than if you were having to do a topo sort for a given event sequence.
 
Personally, I find that it's easier to think of the publishers and listeners as two columns in a table (instead of as a DAG) - but that's just preference.
 
Also, I posted some code to this listserv a month or two ago that adds instrumentation to the publisher so you can actually see the order of things...  Might be worth trying it out - especially if you are getting into related subjects, etc...
 
- K
 
 
----------------------- Original Message -----------------------
  
From: Bruce Alspaugh compulinkltd@...
Cc: 
Date: Mon, 03 Aug 2009 10:08:34 -0500
Subject: ListEventPublisher event notification order
  
I was looking at this documentation:

http://publicobject.com/glazedlists/documentation/ListEventPublisher.pdf

What is the actual algorithm that GL uses to determine a correct update
sequence?  Are you building a directed acyclic graph (DAG) of the
dependencies and doing a topological sort?

Bruce

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...