It doesn't seem needed at the moment, and we can re-add it
in the future if needed.
Add a timer to occur $seconds from now. $seconds may be fractional, but timers
are not guaranteed to fire at the exact time you ask for.
Add a timer to occur $seconds from now. $seconds may be fractional, but timers
are not guaranteed to fire at the exact time you ask for.
-Returns a timer object which you can call C<< $timer->cancel >> on if you need
-to.
-
=cut
sub add_timer ($$) {
my ($secs, $coderef) = @_;
my $fire_time = now() + $secs;
=cut
sub add_timer ($$) {
my ($secs, $coderef) = @_;
my $fire_time = now() + $secs;
- my $timer = bless [$fire_time, $coderef], "PublicInbox::DS::Timer";
+ my $timer = [$fire_time, $coderef];
if (!@Timers || $fire_time >= $Timers[-1][0]) {
push @Timers, $timer;
if (!@Timers || $fire_time >= $Timers[-1][0]) {
push @Timers, $timer;
-package PublicInbox::DS::Timer;
-# [$abs_float_firetime, $coderef];
-sub cancel {
- $_[0][1] = undef;
-}
-
1;
=head1 AUTHORS (Danga::Socket)
1;
=head1 AUTHORS (Danga::Socket)