brendan has asked for the wisdom of the Perl Monks concerning the following question:
My issue is that on timeout I get ERROR: timeout and then the script hangs. I want the script to recover from error and get more tweets.my $done = AnyEvent->condvar; my $nt_filter = AnyEvent::Twitter::Stream->new( username => 'username', password => 'pass', method => 'filter', follow => join(',', @uids), on_tweet => sub { my $tweet = shift; my $file = "path/to/file"; open(FILE, ">", $file); close(FILE); my $json_output = to_json($tweet, {utf8 => 1}); # some function calls }, on_error => sub { my $error = shift; debug "ERROR: $error"; }, timeout => 45, ); $done->recv;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AnyEvent::Twitter::Stream hanging on on_error timeout
by Anonymous Monk on Oct 03, 2012 at 15:27 UTC |