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

FreeBSD Manual Pages

  
 
  

home | help
Qudo::Manual::JA::TutoUser(Contributed Perl DocumQudo::Manual::JA::Tutorial(3)

NAME
       Qudo::Manual::JA::Tutorial - Qudo's sample code document	lang:ja

DESCRIPTION			    _
       Qudoa<section>Jobaa|caaaaa<<a aClienta"Workeraa1/2aeaaa?e|aaaa3/4aa
		    _
       aaa<section>a a<micro>a^3aa<<ac"aaaaaaaaaaa(R)a1/2aeae^1ae^3a<<axaa|e<section>Lea~aa|aaa3/4aa

~a3/4~aoa<section>~a~a<<   _
       Qudoaa1/2?aa<<a aa1/4a?aa^1aacaaaaa<<Qudoc"a(R)aa1/4a?aa1/4a^1ae"-
       a(R)aaa_e|aaaa3/4aa     _
       c3/4a"a 3/4a?aa|aaRDBMSa	aMySQLa,aSQLitea,aPostgreSQLaa<section>aa

       a^1a-			_
       a1/4aa(R)setupa<section>a a>>a+-a(R)qudoa^3aa^3aa<section>e!aLa|aa aa

client				      _		    _
       Qudoa<section>Job Queueingae!aa a(C)axaca^3aa a>>Ya,a(R)aaa<<ae,aa3/4a

	   # in	your script:
	   use Qudo;
	   my $client =	Qudo->new(
	       driver_class => 'Skinny', # DBIx::Skinny
	       databases => [
		   +{
		       dsn	=> 'dbi:SQLite:/tmp/qudo.db',
		       username	=> '',
		       password	=> '',
		   }
	       ],
	   );

	   # enqueue job
	   $client->enqueue("Your::Worker::Mail", { arg	=> $user->email, uniqkey => $user->login_id});
				    _
       a3/4aQudoa(R)aaaa,a<section>a aaa1/2aeaa3/4aa
							      _
       JobaQueueingaaaa1/4a?aa1/4a^1aaea(R)aa|aaaa,a<section>a aaa1/2aeaa3/4aa
		      _
       Qudoa<section>a exae<degree>a(R)aa1/4a?aa1/4a^1a,a(R)aeYc<paragraph>aa<micro>aa1/4aaa|aa3/4aa
		       _				 _
       aaaa,a<section>a	aa1/2aeaea(R)c~~aoa1/4ae<degree>a a?aaaa1/4a?aa1/4a^1aeYc<paragraph>aea	+-a(R)hashrefaeaa<<aa|a

       aa(R)aaaa!a~a^3a^1aae,!aa1/2ca<<aa|aa aaa
			       _
       a1/2aeaaaaaa,a<section>a	aaaa<<Jobaenqueueaa3/4aa

       enqueuea!a1/2aaa(R)
			   _
       c~~a,a1/4ae<degree>a Jobaa|caaaWorkera(R)packagea
			   _
       c~~aoa1/4ae<degree>a Workeraa1/2?aa1/4ae<degree>a(R)aea +-
				   _
       aa(R)a3/4a(R)a 'aaJobaa|caaa a(C)a^1a"aa|Your::Worker::Mailaaea(R)aa

       a|caaaa1/4ae<degree>a"aa|$user->emaili1/4a!a1/4a<<acaa~a^1i1/4aaea(R)aa
		      _
       Joba(R)a|aa1/4a aa1/4a"aa|$user->login_idi1/4a-
       a<degree>axa^3IDi1/4aaea(R)aa|aa3/4aa
										    _
       aa(R)a>>c~~aoa1/4ae<degree>a(R)hashrefa<<aea(R)aoaeYaaaaa.a<section>a^3a"aa|a aa>>Ya,aaaa3/4a

       run_after a|
       aaa<<c<section>ae<degree>aaea(R)aaaa"a<section>ac3/4a"aaa1/2c<section>a3/4a<<a|caea<section>aaaaaaea(R)aoaeYa3/4aa

       priority	 a|
       aaa<<aaaao|aaea(R)aaaa"a<section>aaa(R)c"(R)e!a(R)joba(R)a,-
       a<section>priotiryaxae<<aaa(R)aae a<<a|caaaa3/4a
	_		     _
       a a(C)axaca^3aae!aa|ca aaa aa<section>aa
	   _
       aa"a aaaaa1/2aeaaYour::Worker::Mailaa|caa|aaa3/4aa

worker
       queueingaaaJobaa|caa|aaworkeraa1/2aeaa3/4a

	   package Your::Worker::Mail;
	   use base 'Qudo::Worker';
	   sub work {
	       my ($class, $job) = @_;
	       print $job->arg;	#print $user->email;

	       # send mail process...

	       $job->completed;	# finished job!
	   }
	   1;
				     _
       Qudo::Wokerac<paragraph>ae?aaa a(C)a^1aa1/2aeaa

       aa?aaworka!a1/2aaaaaa1/4aa1/4a(C)axaaa|aa aaa
					      _
       worka!a1/2aaa(R)c~~aoa1/4ae<degree>a<<a Joba(R)aea +-aa,,aaaaLa|aa3/4aa

       $job->arga!a1/2aaa<section>Queueingaaea<<aea(R)aaaWorkera<<a1/2?aLa|a>>aaa"aea(R)aaaa1/4ae<degree>aea +-aae 1/4c'aaa|aa3/4aa
				       _
       ae~!a<<a	workerae<micro>.aaaa^1a	aaaaaa>>Ya,a(R)aaa<<c"aeaa3/4a

	   # ex) qudo-worker.pl	:
	   use Qudo;
	   my $worker =	Qudo->new(
	       driver_class => 'Skinny',
	       databases => [
		   +{
		       dsn	=> 'dbi:SQLite:/tmp/qudo.db',
		       username	=> '',
		       password	=> '',
		   }
	       ],
	       manager_abilities => [qw/Your::Worker::Mail/], #	set worker
	   );
	   $worker->work(); # boot manager
	   # work work work!
		       _								   _
       clienta"aaaaa<<a	a1/4a<<a1/4aa1/2?aaa1/4a?aa1/4a^1aaea(R)aa|Qudoa(R)aaaa,a<section>a aaa1/2aeaa3/4aa

       aa(R)aea<<manager_abilitiesa(R)a1/4ae<degree>aaxaaLa|a
				  _
       aa(R)workerac(R)!caaWorkera a(C)a^1aaea(R)aa3/4aa

       $worker->work()a!a1/2aaaa1/4a^3aoaaa"a<section>a
			_	   _
       JobaQueueingaaaae a<<Workera a(C)a^1aa1/4a^3aoaa|a|caaa|aa3/4aa
		 _
       aoae~ca<<a aaa aa<section>aa

       c<degree>!aa<section>aa:)

       worka!a1/2aaaa<section>a	c!ea<<a1/4aacocaaJobaQueueingaa^3a<<Joba<<a 3/4a?aaWorkera<<a|cac<section>>>e-
       ^2aaa3/4aa

   Driver	      _
       Qudoa<section>a Jobastoreaaa>>c<micro>a?aa.(R)aae?aaaoaa<section>aa3/4aa
			    _
       aaa(C)a<<aa<section>a DBIx::Skinnyaa(C)c"aRDBMSaa(C)c"aaDriveraa1/2?aaa3/4aa
		       _
       Skinnya>>Yaxa<<a	DBIaa<micro>aa1/4aaa|aa3/4aa

       DriveraHookaPluginaae<section>aaY1/2aa<<ae,aaoaa<section>aa3/4aa(R)a<section>aDBICaa1/2?aaaaooaCDBIaa1/2?aaaaooaData::Modelaa1/2?aaaaooaaa(C)e^2aaeaa"aeaa3/4aa(R)a<section>

       aY1/2aa<<ae,aa|aa aa:)

       ae,aaaaeaa|aaaaa"a"a|aaaaaa<section>a:)
			    _
       aY1/2aa<<ae,aaDrivera

	   Qudo->new(
	       driver_class => 'Your::Driver',
	       databases => [
		   +{
		       dsn	=> 'dbi:SQLite:/tmp/qudo.db',
		       username	=> '',
		       password	=> '',
		   }
	       ],
	   );

       driver_classa<<e"a(R)aaaa"a<section>a1/2?aaoaa<section>aa3/4aa

perl v5.32.1			  2010-11-08	 Qudo::Manual::JA::Tutorial(3)

NAME | worker

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

home | help