On Mon, Oct 27, 2003 at 11:19:30AM -0800, Justin Mason wrote:
| 
| SPF's code will almost definitely need surgery.  Taking the AS code as an
| example, I'd suggest:
| 
|   new()
| 
|         create object; fire off first "txt" DNS query
| 
|   is_ready()
| 
|         returns 0 until we no longer need to wait for DNS queries
|         to return -- ie. returns 1 when everything has completed
|         and we have a response.
| 
|   animate()
| 
|         (like that nomenclature!) handle "next step" lookups,
|         if required.
| 
|   result()
| 
|         collate results, return them.  If (!is_ready()), then busy-wait,
|         calling animate()/sleep() until they are ready.
| 

That sounds good; I will move to this model internally and preserve the
existing API to just run an event loop.

I assume ->animate() will be called per-object so I don't have to worry
about making the class animate all the instances?

Reply via email to