Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Qudo::Worker(3)	      User Contributed Perl Documentation      Qudo::Worker(3)

NAME
       Qudo::Worker - superclass for defining task behavior of Qudo's work

SYNOPSIS
	   package Myworker;
	   use base qw/	Qudo::Worker /;

	   sub work {
	       my ($self , $job	) = @_;

	       my $job_arg = $job->arg();
	       print "This is Myworker's work. job has argument	== $job_arg \n";

	       $job->completed(); # or $job->abort
	   }
	   1;

DESCRIPTION
       Qudo::Worker is based on	all your work class of using Qudo.

       Your application	have to	inherit	Qudo::Worker anyway.  And it has to
       have 'work' method too.

       'work' method accept Qudo::Job object at	parameter.  If your work
       complete	, you may call Qudo::Job->complete() method.

WORKER SETTING
   max_retries
	   package Your::Worker;
	   use base 'Qudo::Worker';
	   sub max_retries { 2 }
	   sub work { ... }

       How many	times it retries if worker doesn't succeed is set.  It is
       retried two times in this example.  By default, return 0. no retry.

   retry_delay
	   package Your::Worker;
	   use base 'Qudo::Worker';
	   sub retry_delay { 10	}
	   sub work { ... }

       returns the number of seconds after a failure workers should wait until
       retry a job that	has already failed retry_delay times.  By
       default,return 0	seconds

   grab_for
	   package Your::Worker;
	   use base 'Qudo::Worker';
	   sub grab_for	{ 3600 }
	   sub work { ... }

       Returns the number of seconds workers of	this class will	claim a
       grabbed a job.  By default,return 3600 seconds.

   set_job_status
	   package Your::Worker;
	   use base 'Qudo::Worker';
	   sub set_job_status {	1 }
	   sub work { ... }

       set the flag.  When flag	is the truth, the processing result of worker
       is preserved in DB.

perl v5.32.1			  2010-11-08		       Qudo::Worker(3)

NAME | SYNOPSIS | DESCRIPTION | WORKER SETTING

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Qudo::Worker&sektion=3&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help