Open nginxsantos opened 6 years ago
Hi,
it should be possible to use through another event loop. Check poller_libev.c and poller_libevent.c.
Once a request handler is called it has to finish the processing of that request, so it may block your program if you dont use threads.
Do you refer to that as asynchronous handling or are you referring to something else?
Regards-
I am working on putting this into MiSTer's game loop, and I need it to be called periodically from the main loop.
I separated onion_listen into three functions, a setup, poll, and cleanup. I had to make two versions of onion_poller_poll, one called: onion_poller_poll_once that get's rid of the while, and passes 0 in for epoll. I need to clean this up, and figure out how to test it. Do you think something like this would be a patch you would consider accepting? I think it is fairly clean. I am just a little confused about this path:
if (o->flags & O_ONE) {
Hi,
of course I will consider merging!
About that if
, there is one mode that only serves one request and returns from onion_listen, that's the branch for that mode. But actually it is not very tested. It was useful at the beginning but later was superseded by the poll mode.
Sounds great. I will clean up my code and try to submit a pr. Thanks for the explanation of the if, that makes more sense now. I think I can pass some arguments to the polling function and not duplicate the code.
Hi, Can this run inside my application's event loop or it has to have its own event loop? Also, does it support asynchronous handling Thanks, santos