I have been messing around with an aplication that will interface with irc as a gui. Now I coded the gui in Tk which is an event based module which enters into an endless loop waiting for and handling event calls by its very nature. Now I am also using Net::IRC to interface with the irc servers. This module however is also event based and also enters into an endless loop ($irc->start) which waits for and handles events.

Now the authors of Net::IRC forsaw this being an issue so they came up with the do_one_loop() function. However I am having difficulty coming up with a way where I can implement this function and return control back to Tk every time but still have the IRC module poll endlessly for events and as close as real time as possible. Right now I simply have a button which initiates the do_one_loop() function but this is a manual poll for info and not automatic. If I use the $irc->start function then the Net::IRC module never returns control back over to Tk and the gui appears to hang and becomes unusable.

Does anyone have any nifty ideas on how to share control back and forth real time between these two modules?


In reply to Event based modules playing nice together? by Elijah

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.