+Example: To include a library such as adns, you would add \s-1IO\s0 watchers
+and a timeout watcher in a prepare handler, as required by libadns, and
+in a check watcher, destroy them and call into libadns. What follows is
+pseudo-code only of course:
+.PP
+.Vb 2
+\& static ev_io iow [nfd];
+\& static ev_timer tw;
+.Ve
+.PP
+.Vb 9
+\& static void
+\& io_cb (ev_loop *loop, ev_io *w, int revents)
+\& {
+\& // set the relevant poll flags
+\& // could also call adns_processreadable etc. here
+\& struct pollfd *fd = (struct pollfd *)w->data;
+\& if (revents & EV_READ ) fd->revents |= fd->events & POLLIN;
+\& if (revents & EV_WRITE) fd->revents |= fd->events & POLLOUT;
+\& }
+.Ve
+.PP
+.Vb 7
+\& // create io watchers for each fd and a timer before blocking
+\& static void
+\& adns_prepare_cb (ev_loop *loop, ev_prepare *w, int revents)
+\& {
+\& int timeout = 3600000;truct pollfd fds [nfd];
+\& // actual code will need to loop here and realloc etc.
+\& adns_beforepoll (ads, fds, &nfd, &timeout, timeval_from (ev_time ()));
+.Ve
+.PP
+.Vb 3
+\& /* the callback is illegal, but won't be called as we stop during check */
+\& ev_timer_init (&tw, 0, timeout * 1e-3);
+\& ev_timer_start (loop, &tw);
+.Ve
+.PP
+.Vb 6
+\& // create on ev_io per pollfd
+\& for (int i = 0; i < nfd; ++i)
+\& {
+\& ev_io_init (iow + i, io_cb, fds [i].fd,
+\& ((fds [i].events & POLLIN ? EV_READ : 0)
+\& | (fds [i].events & POLLOUT ? EV_WRITE : 0)));
+.Ve
+.PP
+.Vb 5
+\& fds [i].revents = 0;
+\& iow [i].data = fds + i;
+\& ev_io_start (loop, iow + i);
+\& }
+\& }
+.Ve
+.PP
+.Vb 5
+\& // stop all watchers after blocking
+\& static void
+\& adns_check_cb (ev_loop *loop, ev_check *w, int revents)
+\& {
+\& ev_timer_stop (loop, &tw);
+.Ve
+.PP
+.Vb 2
+\& for (int i = 0; i < nfd; ++i)
+\& ev_io_stop (loop, iow + i);
+.Ve
+.PP
+.Vb 2
+\& adns_afterpoll (adns, fds, nfd, timeval_from (ev_now (loop));
+\& }
+.Ve
+.ie n .Sh """ev_embed"" \- when one backend isn't enough..."
+.el .Sh "\f(CWev_embed\fP \- when one backend isn't enough..."
+.IX Subsection "ev_embed - when one backend isn't enough..."