Skip to content

Commit

Permalink
sample
Browse files Browse the repository at this point in the history
  • Loading branch information
kazeburo committed Jun 14, 2012
1 parent ff9f994 commit 5c6b362
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions sample.pl
@@ -0,0 +1,32 @@
#!/usr/bin/perl

use strict;
use warnings;
use lib qw/lib/;
use Proclet;

my $proclet = Proclet->new;
$proclet->service(
code => sub {
local $0 = "$0 (sleep 5)";
warn $0;
sleep 5;
},
worker => 2
);
$proclet->service(
code => sub {
local $0 = "$0 (sleep 2)";
warn $0;
sleep 2;
},
worker => 3
);
$proclet->service(
code => sub {
exec('/usr/bin/memcached');
},
);

$proclet->run;

0 comments on commit 5c6b362

Please sign in to comment.