If i used Event::loop instead of while(1){}. it is working properly.
...and that's your answer. AFAIK, Event does not implement asynchronous events, which means that your code itself has to make sure that the routine one_event() is being called sufficiently often (which is what Event::loop() does, essentially). In other words, there are no provisions made for interrupting loops like while(1){}.
Maybe you could use more than one process or threads, and delegate the event 'polling' to one of them? (The details would depend on what data needs to be shared, etc.)
In reply to Re: Event Driven - timer
by almut
in thread Event Driven - timer
by perlthirst
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |