一次典型应用的函数调用
struct event ev;
struct event_base *base;
struct event_base *base = event_base_new();
event_set(&ev, fd, EV_READ|EV_PERSIST, callback_fn, (void *)arg);
|
|__> event_assign(ev, current_base, fd, events, callback, arg)
|
|____> ev->ev_base = base;
ev->ev_callback = callback;
ev->ev_arg = arg;
ev->ev_fd = fd;
event_base_dispatch(base);
|
|__>event_base_loop(base,0)
|
|__> res = evsel->dispatch(base, tv_p);
| |
| |_____>epoll_wait
|
|__>event_process_active (base)
|
|__>event_process_active_single_queue
|
|__>
evcb_callback =*ev->ev_callback;
evcb_callback(ev->ev_fd, res, ev->ev_arg);
|
|___> accept