First, you should use POE::Kernel's sig_child() method to register a SIGCHLD handler for POE::Wheel::Run children. This will ensure your child processes get reaped, otherwise your machine will clog up with them.
sub worker_start { my ($kernel,$session,$heap,@args) = @_[KERNEL, SESSION, HEAP, ARG0 .. + $#_]; $heap->{postback} =$args[0]; $heap->{filename} =$args[1]; $heap->{cmdline} = POE::Wheel::Run::Win32->new(...); $kernel->sig_child($heap->{cmdline}->PID, "sig_child"); }
The problem with reposting the job request from a worker is that the worker becomes the requester. It will be kept alive until the reposted job is done, and it will receive the results of that job. Not what you want.
As I see it, you have two options. First, you could return a "busy, try again" sort of response in this case. The requesting session would then need to repost the request itself. This is perhaps the cleanest generic design, since the application should have final say over policy.
Your second option is to contact the author and ask for a "retry" feature where a worker can reënqueue a job when necessary. If you can provide a patch and testcase, that would even be better. See http://rt.cpan.org/ for contact instructions.
In reply to Re: How to enqueue again from the job in POE::Component::JobQueue?
by rcaputo
in thread How to enqueue again from the job in POE::Component::JobQueue?
by wl2776
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |