[Dancer-users] Stand Alone applications using Dancer

Gabor Szabo szabgab at gmail.com
Sun Apr 4 07:24:32 UTC 2010


2010/4/3 XANi <xani666 at gmail.com>:
> Dnia 2010-04-03, sob o godzinie 01:36 +0300, Gabor Szabo pisze:
>
> Imo simplest solution would be to just run separate thread, something
> like:
>
> use threads;
> my $t = threads->create(\&browser);
> dance;
>
> sub browser () {
>  sleep 1 ;
>  Browser::Open::open_browser("http://localhost:3000/");
> }
>

I use now fork() but more or less the same idea.

my $pid fork();
die if not defined $pid;
if ($pid) {
    dance;
} else {
    sleep 1;
    Browser::Open::open_browser("http://localhost:3000/");
}

but that still does not take in account the --port the user can supply
nor does it check
if the dancer server really starter successfully.

regards
   Gabor


More information about the Dancer-users mailing list