Mojolicious + Plack asynchronous work

53 views
Skip to first unread message

Alexey Stavrov

unread,
Apr 13, 2015, 2:38:19 AM4/13/15
to mojol...@googlegroups.com
Can the Mojolicious work asynchronously when it deploy with Plack?

I attempt to run such application

#!/usr/bin/perl


use strict;
use warnings FATAL => 'all';


use v5.10;


use Mojolicious::Lite;


get '/' => sub {
 
my $c = shift->render_later;
  $c
->ua->get('http://google.com' => sub {
    $c
->render(text => 'Ok');
 
});
};


app
->start;


with such command plackup 1.pl

Alexey Stavrov

unread,
Apr 13, 2015, 9:39:07 AM4/13/15
to mojol...@googlegroups.com
Need to specify server in arguments because HTTP::Server::PSGI can't work asynchronously, but this code doesn't work too with such command:
plackup 1.pl -s Twiggy

понедельник, 13 апреля 2015 г., 11:38:19 UTC+5 пользователь Alexey Stavrov написал:
Reply all
Reply to author
Forward
0 new messages