Proclet::Declare - Declare interface to Proclet
use Proclet::Declare;
color;
env(
DEBUG => 1,
FOO => 1
);
service('web', 'plackup -p 5963 app.psgi');
service('memcached', '/usr/local/bin/memcached', '-p', '11211');
service('worker', './bin/worker');
scheduled('tag', '0 12 * * *', sub { MyDailyWork->run });
worker(
'worker' => 5
);
run;
Proclet::Declare supports to use Proclet declare style
- color
- Sets colored log
color(); #enable
color(1); #enable
color(0); #disable
default: disabled
- env
- Environment values
worker(
FOO => 'abc'
BAR => 'efg'
);
- service
- Sets the service
# coderef
service('tag', sub { MyWorker->run });
# exec command
service('tag', '/usr/local/bin/memcached','-vv');
- scheduled
- scheduled job like cron
# coderef
scheduled('tag', '0 12 * * *', sub { MyDailyWork->run });
# exec command
scheduled('tag', '0 12 * * *', 'my_daily_job','-execute');
- worker
- Number of children to fork
worker(
process_name => 1
process_name => 5
);
- run
Masahiro Nagano <kazeburo {at} gmail.com>
Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.