Senph::Async
sub run { my $self = shift; my $httpserver = Net::Async::HTTP::Server::PSGI->new( app => $self->psgi->app ); $self->loop->add($httpserver); my $port = $ENV{SENPH_PORT} || 8080; $httpserver->listen( addr => { family => "inet", socktype => "stream", port => $port, }, on_listen_error => sub { die "Cannot listen - $_[-1]\n" }, ); $log->infof( "Starting up on http://localhost:%i", $port ); $self->loop->run; }