logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: how to clean the memory ?: msg#00011

Subject: Re: how to clean the memory ?
here is a chunk:

sub wheel - gets all the urls from the file
sub work - spawn new session to parse that url and postback
sub done  - end

sub wheel {
 $_[HEAP]->{wheel}=POE::Wheel::FollowTail->new(
 Filename => $file,
 InputEvent =>'work',
 Seek =>0,
 );
}

sub work {
 return if $heap->{KIDS}>=$heap->{KIDMAX};
 return unless my $url1=shift @{$heap->{URLS}};
 $heap->{KIDS}++;
POE::Component::My::Master->spawn(UA=>$heap->{UA},TODO=>[ $url1 ],
 POSTBACK => $_[SESSION]->callback("done"),
 );
}

sub done {
 $heap->{KIDS}--;
}
---
Professional hosting for everyone - http://www.host.ru




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>