Skip to content

Commit

Permalink
switch from BREAK_ONE to BREAK_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 21, 2012
1 parent 3293de7 commit 390d5ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/Mojo/Reactor.pm
Expand Up @@ -113,10 +113,12 @@ sub watch {

sub _timer {
my ($self, $cb) = (shift, shift);

my $t = {cb => $cb, @_};
my $id;
do { $id = md5_sum('t' . time . rand 999) } while $self->{timers}->{$id};
$self->{timers}->{$id} = $t;

return $id;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Reactor/EV.pm
Expand Up @@ -21,7 +21,7 @@ sub recurring { shift->_timer(shift, 1, @_) }
# Yeah... where do I fill it up?"
sub start {EV::run}

sub stop { EV::break(EV::BREAK_ONE) }
sub stop { EV::break(EV::BREAK_ALL) }

sub timer { shift->_timer(shift, 0, @_) }

Expand Down
2 changes: 1 addition & 1 deletion t/mojo/reactor_ev.t
Expand Up @@ -215,7 +215,7 @@ Mojo::IOLoop->client(
$client_err = $@;
}
);
Mojo::IOLoop->timer(1 => sub { EV::break(EV::BREAK_ONE()) });
Mojo::IOLoop->timer(1 => sub { EV::break(EV::BREAK_ALL()) });
EV::run();
ok !Mojo::IOLoop->is_running, 'loop is not running';
like $server_err, qr/^Mojo::IOLoop already running/, 'right error';
Expand Down

0 comments on commit 390d5ff

Please sign in to comment.