A lot of work to make available asynchronous initialization of services,
pipes, etc.

Now asio.ev.Loop have instance method, which returns global ioloop, and
add_timeout, add_handler - which are the same as in tornado.ioloop.IOLoop's methods.

Example of asynchronous pipe connection:

from cocaine.asio.pipe import Pipe
from cocaine.asio.ev import Loop

io = Loop.instance()

def callback(result):
    try:
        print result.get()
    except Exception as err:
        print err
    else:
        print "OK"

p = Pipe(("127.0.0.1", 10053))
p.async_connect(callback, 1)
io.run_for_time(1)

Example of asynchronous locator resolving:

from cocaine.asio.ev import Loop
from cocaine.asio.locator import Locator

io = Loop.instance()

def callback(res):
    try:
        print res.get()
    except Exception as err:
        print err

l = Locator()

l.async_resolve("node2", "localhost", 10053, callback, 1)
l.async_resolve("node", "localhost", 10053, callback, 1)

io.run_for_time(1)
Add asynchronous reconnect for services.

Example:
from cocaine.asio.ev import Loop
from cocaine.services import Service

s = Service("node")
def callback(res):
    try:
        print res.get()
    except Exception as err:
        print err

io = Loop.instance()

for i in xrange(0, 20):
    s.async_reconnect(callback, 10)

io.run_for_time(1)