Skip to content

Commit

Permalink
Notify the user of timeouts through the error callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rafl committed Feb 17, 2013
1 parent e7f31c8 commit e3aa176
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for Net::Bullfinch

{{$NEXT}}
* Notify ->iterate_async users of request timeouts through the error
callback (Florian Ragwitz).x

0.14 Feb 14 2013
* Add ->iterate_asnc as an AnyEvent compatible way of making requests
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/Bullfinch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ sub iterate_async {

$self->_client->get($rname.'/t='.$self->timeout, sub {
my ($resp) = @_;
return $result_cb->() unless defined $resp;
return $error_cb->('timeout') unless defined $resp;

my $decoded = decode_json $resp;
return $result_cb->() if exists $decoded->{EOF};
Expand Down

0 comments on commit e3aa176

Please sign in to comment.