Bot-ChatBots

 view release on metacpan or  search on metacpan

lib/Bot/ChatBots/Role/Poller.pm  view on Meta::CPAN

   return sub {
      return if $is_busy;
      $is_busy = 1; # $on_data below will reset $is_busy when ready
      $self->poll($on_data, $args);
   };
}

sub schedule {
   my ($self, $interval, @rest) = @_;
   my $poller = $self->poller(@rest);
   Mojo::IOLoop->timer(0 => $poller);
   Mojo::IOLoop->recurring($interval, $poller);
   return $self;
}

1;



( run in 0.579 second using v1.01-cache-2.11-cpan-49f99fa48dc )