Skip to content

Commit

Permalink
Remove on_error()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Henning Thorsen committed Aug 21, 2012
1 parent 71f520f commit 1d19d1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions lib/Mojo/Redis.pm
Expand Up @@ -189,7 +189,7 @@ sub subscribe {
my ($str, $error) = @_;
$self->error($error);

$self->on_error->($self);
$self->emit(error => $error);
$self->ioloop->remove($id);
}
);
Expand Down Expand Up @@ -331,13 +331,6 @@ sub _inform_queue {
$self->{_queue} = [];
}

# avoid pod test
*on_error = sub {
my $self = shift;
warn "on_error() is deprecated! use on(error => sub {}) instead";
$self->on(error => shift);
};

1;
__END__
Expand Down
2 changes: 1 addition & 1 deletion t/leak.t
Expand Up @@ -20,7 +20,7 @@ plan tests => 4;

my $redis = Mojo::Redis->new(server => $ENV{REDIS_SERVER}, timeout => 5);

$redis->on_error(sub { });
$redis->on(error => sub {});

no_leaks_ok {
$redis->ping(\&cb_ioloop_stop)->ioloop->start;
Expand Down

0 comments on commit 1d19d1a

Please sign in to comment.