On 10/31/2013 02:47 PM, Amos Jeffries wrote: > For my edification can you explain a bit more please about why libecap > needs an entire EventLoop engine all of its own? > What is so different about engines that you cant simply use scheduled > Calls and events from ecap?
An async adapter may need to get control once every host main loop iteration (so that the adapter can resume async transactions that became ready while Squid was waiting for an I/O). Besides EventLoop engines, there is no other good "once per main loop iteration" mechanism in Squid AFAIK. There are "heavy events" that come close, but they are not a good fit conceptually because they are supposed to occur based on time and are not supposed to occur so frequently. It felt like I would be abusing them for this purpose. Besides they are currently broken IIRC. Future libecap versions may add simple eventfd(2)-like API that may make this additional engine unnecessary. Thank you, Alex.