[Catalyst] Client Disconnect Behavior and Detection

2012-07-12 Thread neil

Having a problem with trying to stop further execution of actions in a
controller when the client has disconnected from the server.

I am using XML::Writer in a controller to write directly to the response
object, treating as a file handle. The basic setup is as follows:

  my $writer = XML::Writer->new(
OUTPUT  => $c->response,
DATA_INDENT => 2,
DATA_MODE   => 1,
CHECK_PRINT => 1
  );

Which all works fine as resulting code outputs to the $writer this is
fed through the response. 

Thing is, as this is generally a lengthy streaming process, if the
client was to disconnect the process continues to run, which is not
desirable. From the XML::Writer documentation, the option has been set
on this instance to CHECK_PRINT, meaning if a write to the file handle
were to fail then an error would be thrown, from which further
processing can be safely shut down.

But the problem here is from the Writer's point of view there is nothing
wrong with the file handle (response) even though the client has
disconnected.

Whose responsibility is this? Engine or Framework? Does anyone know of a
reliable way in which the client hang-up can be detected and where to
look where this should be happening.

Neil

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: Re [Catalyst] How to update data of already logged-in user?

2012-07-12 Thread Tomas Doran

On 12 Jul 2012, at 07:18, Sergey Dmitriev wrote:

> Thank you Lu. BTW, set_authenticated is marked as internal method in 
> documentation, so it could be changed some day.
> 

Well volunteered?

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: prepare_body_chunk in Catalyst 5.9

2012-07-12 Thread Eric Wright
Looking into this further - in the the source for Catalyst I see that the
prepare_body statement has been moved to the Request object removing the
ability to hook into this event via the Plugin architecture. I was using
this hook to monitor the number of chunks transmitted to the server for
monitoring upload progress. I take it this approach is not going to be
supported any longer? From a design perspective, would it be recommended
that I instead extend and implement my own Request class for this purpose?
Appreciate the feedback.

On Thu, Jul 12, 2012 at 1:26 PM, Eric Wright  wrote:

> Has something changed in Catalyst 5.9 with regards to prepare_body_chunk?
> I had some dependent Plugin code that is no longer working.
>
> None of the following method modifiers are triggered:
>
> around 'prepare_body_chunk' => sub {
> my ( $orig, $c, $chunk ) = @_;
> print STDERR "AROUND prepare_body_chunk\n";
> $c->$orig(@_);
> };
>
> before 'prepare_body_chunk' => sub {
>   my ($self) = @_;
>   print STDERR "BEFORE prepare_body_chunk\n";
> };
>
> after 'prepare_body_chunk' => sub {
>   my ($self) = @_;
>   print STDERR "AFTER prepare_body_chunk\n";
> };
>
> I am able to hook into other parts of the Catalyst lifecycle like
> "prepare_body" and "dispatch". Am I overlooking something obvious here?
>
> Any idea what could be wrong?
>
> -Eric
>



-- 
Eric Wright
Linescale, Inc.
ewri...@linescale.com
203.572.1750 
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] prepare_body_chunk in Catalyst 5.9

2012-07-12 Thread Eric Wright
Has something changed in Catalyst 5.9 with regards to prepare_body_chunk? I
had some dependent Plugin code that is no longer working.

None of the following method modifiers are triggered:

around 'prepare_body_chunk' => sub {
my ( $orig, $c, $chunk ) = @_;
print STDERR "AROUND prepare_body_chunk\n";
$c->$orig(@_);
};

before 'prepare_body_chunk' => sub {
  my ($self) = @_;
  print STDERR "BEFORE prepare_body_chunk\n";
};

after 'prepare_body_chunk' => sub {
  my ($self) = @_;
  print STDERR "AFTER prepare_body_chunk\n";
};

I am able to hook into other parts of the Catalyst lifecycle like
"prepare_body" and "dispatch". Am I overlooking something obvious here?

Any idea what could be wrong?

-Eric
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Catalyst Wiki attachment

2012-07-12 Thread Tobias Kremer
Does anyone know where all the attachments went?

http://wiki.catalystframework.org/wiki/sitesrunningcatalyst

Cheers
Toby

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/