Nick
nick at dd.revealed.net
Mon Apr 17 17:37:49 EDT 2006
Graham Dumpleton wrote: > On 18/04/2006, at 4:57 AM, Nick wrote: >> As an example to follow up on this, in your XSLT parser, you would have: >> >> for streamlet in filter: >> filter.req.passes += 1 >> streambuffer.write(streamlet.replace('\r\n', '\n')) >> >> ("if streamlet is None" is not required at this point) > > You still possibly need to know when None was read, as you still need to > call > close() on the filter. The iterator would stop when None was read, so that's implicit. Again, this idea assumes a producer/consumer model rather than the repeated calling model that is supported now. And that, of course, implies some kind of thread or fork and communication through a pipe or some other form of IPC, unless there's some aspect of the apache API that I'm not aware of (which is highly possible :) That may be a code path you don't want to take, but I thought I'd throw the idea out there anyway. And there may be a way to implement this that isn't as complex as I think it might be. Nick
|