Re: Mason 1.3 autoflush behaviour change

Jonathan Swartz <[email protected]>
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
I suppose we could also change the default to enable_autoflush=>1. I was 
just hoping to make the higher performance option the default, but maybe 
that's silly. static_source is the biggest win and it isn't (can't be) 
the default anyway.

But Jesse, can I ask how you're using autoflush and why several 
well-placed manual $m->flush_buffer calls wouldn't work as well?

Jon

Jonathan Swartz wrote:
> The problem is that Mason only sees lines like
> 
>   $m->autoflush(1);
> 
> at runtime. By that time, the component has already been compiled in 
> such a way that autoflush won't work. Take a look at the object file and 
> you'll understand why.
> 
> If you are using a handler script, you could do something lke
> 
>     my %masonOptions =
>       (comp_root => '...',
>        ...
>        ($HTML::Mason::VERSION >= 1.3 ? (enable_autoflush => 1) : ())
>        );
> 
> And I assume there's an equivalent way to do it with httpd.conf and 
> <Perl> sections.
> 
> But I'm not sure what "supporting" entails wrt RT - do people who 
> download RT write their own handler script or use yours?
> 
> Jon
> 
> Jesse wrote:
> 
>> Tonight, I decided to give RT a go with the newly optimized mason. The
>> only problem is that we use autoflush pretty heavily, since a number of
>> RT's pages can take quite a while to render.  It _looks_ to me like it's
>> going to be impossible to support both Mason 1.2x and Mason 1.3x, if, as
>> I recall, mason 1.2x will scream bloody murder about the unknown
>> "enable_autoflush" parameter and mason 1.3 is upset that I didn't
>> predeclare my autoflushness.  Would it be possible to get mason 1.3x to
>> auto-upgrade to autoflushness the first time it sees an autoflush
>> directive?
>>
>>     Jesse
>>
>>
>> ----
>>
>>
>> As of Mason 1.3, autoflush will only work if
>> L<enable_autoflush|HTML::Mason::Params/enable_autoflush> has been set.
>> This is because components can be compiled more efficiently if they
>> don't have to check for autoflush. Before enabling autoflush you might
>> consider whether a few manual C<$m-E<gt>flush_buffer> calls would work
>> nearly as well.
>>
>>
> 
> 



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.