[e-lang] Adding Reactor to Lamport Slot without immediate send?

Kevin Reid kpreid at mac.com
Tue Dec 5 17:38:22 CST 2006


On Dec 5, 2006, at 16:02, Martin Scheffler wrote:

> I'm using a lamport slot to distribute the state of an object to a  
> different machine.
> I initialize the proxy object on the client with the current value  
> of the lamport slot.
> Then I subscribe the proxy to the lamport by adding it with  
> whenUpdated().
> At this point, the lamport slot immediately sends its value to the  
> proxy, because its generation value at this point is >0.
> Maybe it would make sense to make the generation value of the slot  
> accessible? Then I could subscribe the proxy to updates of the  
> lamport slot as of now.

I've occasionally wanted this too.

I propose that such an extension to EverReporter should provide the  
value bundled, with the generation, to ensure consistency:

? slot.getValue()
# value: "foo"

? slot.getCurrent()
# value: ["foo", 153]


On the other hand, your reactToUpdate could just do nothing but  
resubscribe if the new value is equal to the old one.


On Dec 5, 2006, at 17:48, Mark Miller wrote:
> How did you obtain the current value of the lamport slot?

I assume the slot is near to the 'client' (and possibly a downstream  
presence).

(Martin: If it isn't near, then whenUpdated/1 is just as good as  
getValue for getting the current value.)

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list