Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I think you need to limit your join messages. As far as I understand your code, your bot will try to join all channels, and only after that post the message and part the channel.

Also, your sequence flow seems odd, because in the else branch, you set $data_entry->notified('true'), which seems odd.

I would try looking at either the following batched sequence:

$irc->yield(join => $msg_channel); $irc->yield(privmsg => $msg_channel, $message); $irc->yield(part => $msg_channel);

... or a sequence that keeps track of all channels and their state:

my @channels_to_notify = get_unused_channels(); my @joined_channels; my @notified_channels; # in a timer, every minute or so: while(@channels_to_notify) { if( @joined_channels < 100 ) { my $name = shift @channels_to_notify; join_channel( $name ); }; }; # This should trigger on the message when you(r bot) joins a channel sub on_join { my ($name) = @_; $irc->yield(privmsg => $msg_channel, $message); $irc->yield(part => $msg_channel); }; # This should trigger on the message when you(r bot) parts a channel sub on_part { my ($name) = @_; @joined_channels = grep { $_ ne $name } @joined_channels; };

In reply to Re: POE::Component::IRC event loop stuck? by Corion
in thread POE::Component::IRC event loop stuck? by GodEater

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found