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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.