> Robert wrote:
> >So to decide if a channel is due, just have to read an update_base, and
> add on the frequency *
> >period, then compare that calculated time to current time and see if it
> thus due.
> 
> >After the channel is updated, the update_base gets advanced by
> update_periods until its next
> >calculated due date is in the future. (The update_base doesn't just
> advance one update_period
> >alone, to handle the case where the computer has been abandoned for
> awile).
> >So the conduit would just write the new update_base key and it wouldn't be
> due.
 
> I think the above statments conflict.  I think what you mean is that to
> decide if an update is due I just compare the update_base to the current
> time.  Then after I do the update, I add on frequency * period to the
> current time and store it as update_base.

The behaviour currently isn't quite to add on a (frequency*period) onto the current 
time, to 
handle the case where every update might not take place on its exact time. 

I'll have another go of a exposition and see if I can be less obtuse ;-).
By "due date" I mean the calculated result of a 
[update_base + (period*frequency)].

The current behaviour is set so that the update_base has some meaning. For example, I 
want to 
update The Onion every Wednesday, since the new edition comes out on Wednesday 
morning. So an 
update_base is some Wednesday of whatever month it is, period is a week, and frequency 
is 1.

However, I may sometimes not have my computer on, during Wednesday. Say I miss a 
Wednesday, and 
not update it until that Friday instead. If I just added a (frequency * period) onto 
the 
current time during Friday's update, and stored that as the new update_base, then 
updates would 
start happening on Fridays instead of my desired Wednesdays. So I add a (period * 
frequency) on 
to the update_base, and store that result as the new update_base. 

However, now what if I miss 3 successive Wednesdays before I turn my computer on, and 
happens 
to be a Friday that my computer is turned on? I don't want it to just advance the 
update_period 
by a single (period * frequency), since that would result in it still being due (and 
since I 
just plucked it, I don't need another copy of that same document--I want to wait until 
next 
week's edition comes out). Therefore, I want to keep advancing the update_base by a 
(period * 
frequency), until it results in a due date that is in the future.

Best wishes,
Robert
_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev

Reply via email to