[Divunal-author] Charge interfaces

Christopher Armstrong radix@twistedmatrix.com
Tue, 13 May 2003 16:33:00 -0400


On 2003.05.12 15:09, Christopher Armstrong wrote:
> I implemented it. 

I rewrote it to use a current system, rather than one request/response per
second. Along with this, I implemented reality.chronology, which is a 
simulated real-time scheduler. The two important methods in that are
timer.callLater(ticks_INTEGER, f, ...) and timer.time() --> current age
of reality in ticks. I did this so I could minimize the nuances that
would come about from calculating charge over time. (btw, the length of a
tick is a reactor.callLater(1, ...).)

Another benefit of chronology is that it will make down-time transparent.
When you restart the server, there will be no gap in time for any scheduled
events, as long as all reality coders religiously use chronology as opposed
to the `time' module and reactor.callLater.

Anyway, back to charge.
Right now there's a Radio you can touch or zap (and it will play music),
a battery you can touch or zap (and will blow up if you do it enough) and
connect to a battery charger.

Still todo:
 * make the battery charger a capacitor (right now it's only an IChargeSource
   and never runs out of charge).
 * connect battery to radio (nasty bugs with this)
 * unify IConnectTool and IConnectTarget, there's no reason for them to be 
   separate. In fact, it would be nice if I didn't need the IConnect* at all
   and rather looked up ICharge* implementors.
 * make Connecting try to pick up one of the objects involved before doing 
   the connecting.
 * some other stuff

I'll be getting together with exarkun sometime around the end of the week.

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/