I have an issue I am not sure if it is a bug or not.

In my controller, I have something like this,

package myController;


sub some_action {
    my $self = shift;

    my $delay = Mojo::IOLoop::Delay->new;
    $delay->on(finish => sub {
        my ($delay, $tx) = @_;

        # checkpoint $self - can't call method "req" in Controller.pm line 
261.

        $self->respond_to(
            json => ...,
            html => ...
            any => ...
        );
    });
    $delay->on(error => sub {
        ...
    }
    $delay->steps(sub {
        # UA does something, and uses $delay->begin(0) to pass the tx back.

    });
    $self->render_later;
}

At the checkpoint, $self->tx is not defined anymore. I understand that 
respond_to is probably looking at the req to determine how to render the 
result, however, since somehow the controller ($self)'s tx disappears, the 
call failed. I saw in the documentation and guides that this should be 
fine. I printed ref ($self) at checkpoint, and it is correct (myController 
object). Can someone shed some light as to whether I did something wrong or 
I hit a bug?

Daniel.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to