- Timestamp:
- Jun 22, 2011, 12:37:21 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- bcde7926
- Parents:
- 58f4fb2
- git-author:
- David Benjamin <davidben@mit.edu> (05/24/11 00:36:51)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/22/11 00:37:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Timer.pm
rc6adf17 r074bdaa 3 3 4 4 package BarnOwl::Timer; 5 6 use AnyEvent; 5 7 6 8 sub new { … … 13 15 my $self = {cb => $cb}; 14 16 15 my $name = $args->{name};16 $name = "(unnamed)" unless defined $name;17 18 17 bless($self, $class); 19 18 20 $self->{timer} = BarnOwl::Internal::add_timer($args->{after} || 0, 21 $args->{interval} || 0, 22 $self, 23 $name); 19 $self->{timer} = AnyEvent->timer(%$args); 24 20 return $self; 25 21 } … … 27 23 sub stop { 28 24 my $self = shift; 29 if(defined($self->{timer})) { 30 BarnOwl::Internal::remove_timer($self->{timer}); 31 undef $self->{timer}; 32 } 25 undef $self->{timer}; 33 26 } 34 27
Note: See TracChangeset
for help on using the changeset viewer.