From: Rimon B. <ba...@cs...> - 2003-05-12 12:35:35
|
Hi Steve, It's being caused by a bug! Thanks for reporting this. Most other configurations support the notion of output buffering, and thereby flush(). The mod_python handler does not have a flush(), since the write() function immediately writes to the client. For consistency across different configurations, Spyce buffers on behalf of mod_python, but when flush is called, it gets through to the base output object. This has been fixed, and will be released in v1.3.11. In any case, you really should not need to call flush(). It's called automatically at the end of a request. The only time when it makes sense is if you are need something to go out to the client immediately while another, much longer operation continues at the server. You should be aware to watch for other timeouts in the system if your operations is really long. Also be aware that your I/O performance (and usually also overall performance, since most processing is I/O bound) should improve if you flush less frequently and allow the system to take care of things. All the best, Rimon. On Wed, 30 Apr 2003, Steven D. Arnold wrote: >When I execute the following Spyce code with mod_python on, I get an error. >The Spyce code is: > >[[ response.flush() ]] > >The error is: > >File:/server/apache_1.3.27/htdocs/unr/report-display.spy Message: >AttributeError: flush >Stack: report-display.spy:55, in (main): >response.flush() >/server/spyce/modules/response.py:79, in flush: >self._filter.flush(stopFlag) >/server/spyce/spyceModpy.py:85, in flush: >self.out.flush() >/server/spyce/spyceUtil.py:141, in flush: >self.out.flush() >/usr/local/lib/python2.2/site-packages/mod_python/apache.py:85, in >__getattr__: >raise AttributeError, attr > >This problem doesn't occur under CGI. Any idea what may be causing this? >I'd appreciate being CC'ed on any responses since I seem to be having some >trouble receiving the list right now. > >steve > |