... a thread must return for it to stop ( other than killing it)..... it seems you enqueue 'Stop', but maybe work on a better, more direct way?
while (my $message = $event->dequeue ) {
print "IN HERE\n";
return 1 if $message eq 'STOP';
... maybe $event->dequeue is hanging? ..... maybe experiment there with a counter and see how many times it prints STOP and figure out why it dosn't return ?
... maybe try a time delay to give the eventloop enough loop time to get it all done?
$self->{queue}->enqueue('STOP');
# insert a small Wx time delay here, or use a conditional in the join
+like:
do 1 until $self->{worker}->join;
#or code to wait for the thread count to change
}
in other words find the best Wx way to wait there for the thread to return
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.