Greetings Monks,
Well, I have this rather large application, and I just decided to "convert" a "standard" script into a more object oriented ala POE. (POE seems really handy, particularly in this case).
Anyway, broken down the important code related to the problem I have:
POE::Session->create
( inline_states =>
{ _start => \&startApplication,
searchmode => \&searchMode,
}
);
POE::Session->create
( inline_states =>
{ _start => \&searchUpdate,
}
);
$poe_kernel->run();
# Relevant is also:
sub startApplication {
$poe_main_window->Toplevel(-title => "Search");
.... jadajadajada ....
}
sub searchUpdate {
while(1) {
next if (!$INTERESTING);
! DO ALOT !
}
}
Now, I thought that these two sessions would start as a seperate "thread", but apparently not, since the first one is never shown (the first session is a Tk based GUI). Yes, apparently, there needs to be some $session->postback set else the session will end anyway... (compared to Mainloop) (Why? And how to fix this btw (If I dont wanna set any postbacks...)?)
If I remove the "second" session, the GUI is shown.
Ideas how to run these simultaneously (as this is what POE is supposed to be good at, eh)?
Thanks,
Ace
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.