If I create an event like this:

my $event =
      Event->idle( min        => 60,
                   max        => 180,
                   cb         => $main_loop,
                   repeat     => 1,
                   reentrant  => 0,
                   hard       => 1,
                   prio       => Event::PRIO_NORMAL,
                   desc       => 'Main loop',
                 );

after I call Event::loop the event doesn't "fire" right away. The timer
starts when Event::loop is called, I guess.  I'd like to have one event
ready-to-go when Event::loop is called. I tried

 $event->w->now();
 Event::loop();

but that doesn't seem to do it either. Do I need to create a separate
event like this?

my $one_shot =
      Event->timer( after => 0,
                    cb    => $main_loop,
                 );
  
-- 
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
           ...Nexcerpt... Extend your Expertise

Reply via email to