Hi, Gokul. POE::Kernel->alarm() enqueues an alarm, but it is not like the built-in alarm(). POE's alarms are dispatched by POE::Kernel in between callbacks. Your while() loop pre-empts the dispatcher, so the enqueued alarms never occur.
If your program must delay there, you can use POE::Kernel->run_while() to run POE's dispatcher while a variable is true. Set the variable false from the callback you are waiting for. -- Rocco Caputo <rcap...@pobox.com> On Aug 22, 2012, at 05:54, Gokul Prasad wrote: > Hi, > > Am setting "alarm" in calling a function to check if particular task > has executed properly or what. > > when i place the below code under while loop this alarm function is > not being called, but when i comment while loop, it is just works fine > correctly. > > while(end_time >= current_time){ > $heap->{next_alarm_time} = int(time())+30; > print STDERR "$heap->{next_alarm_time} why ti is printing\n"; > $kernel->alarm(next_task => > $heap->{next_alarm_time});#$heap->{RESULT}->{event}); > } > Not sure why it is happening? any suggestion.please > > > Regards, > gokul