![]() |
![]()
| ![]() |
![]()
NAMEJonk::Client - job enqueue client class. SYNOPSISuse DBI; use Jonk::Client; use DateTime; my $dbh = DBI->connect(...); my $jonk = Jonk::Client->new($dbh, { table_name => 'jonk_job', enqueue_time_callback => sub { DateTime->now->strftime('%Y-%m-%d %H:%M:%S'); }, } ); METHODSmy $jonk = Jonk::Client->new($dbh, $options);Creates a new Jonk object, and returns the object. $option is an optional settings.
my $job_id = $jonk->enqueue($func, $arg);enqueue a job to a database. returns job.id.
my $errstr = $jonk->errstr;get most recent error infomation. ERROR HANDLINGmy $job_id = $jonk->enqueue('func','arg'); if ($jonk->errstr) { die $jonk->errstr; }
|