Having a daemon working absolutely fine with libevents - no problems with the basic use case.

However for a somewhat more complex handler where I need to wait for another event to happen _within_ an event handler - as that determines how I return from that hanlder. I.e. the function I am calling returns immediately - and I need to wait up to X seconds for another handler to be called:

   event_init();
   register xxx handler on socket 1 with REST interface
register zzz handler on socket 2 which gets OK/NOK callbacks from a backend system.
   event_dispatch().
   done.

   xxx_handler() {
        call a function which
                ultimately causes a callback

        wait for zzz_handler() to be called
                with some timeout.

        if (success)
                ... buf write OK
        if (timeout)
                ... buff write timeout
        else
                ... buff write errrr %x
  }

   zzz_hander() {
        parse results
        -> know success or fail
   }

How is this best done ? Can I safely call event_loop (once) within an event ?

Thanks,

Dw


_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to