Now response.write() method of @http doesn't pack data with msgpack.

It turns out the fastcgi-proxy with dealer is not unpacks the response
body with the msgpack.
Fix bug with ignoring verbosity level in logger.

Because of changes in the API synchronous request to the service, the
verbosity level of logging can be compared not with the actual value of the debug
level, but with the address of the generator in the memory, which led to
the installation of the wrong verbosity level of logging.
Now real verbosity level is compared.
Merge branch 'master' of github.com:cocaine/cocaine-framework-python
Make protocol parsing more faster.

Use named constants for every rpc code, instead of string representation
of rpc code.
It looks like: msg.id == RPC_CHUNK (older msg.id ==
PROTOCOL_LIST.index("rpc::chunk")). In test app it gives perfomance boost
near 10%.
Move disown timer to properly handler.

Restart disown timer every heartbeat properly. It avoid situation,
when eventloop doesn't stop on EPIPE.
Services are able to send more than 640Kb in synchronous calls.

The problem was incomplete send a message to the socket, due to the fact
that the recorded number of bytes in the socket buffer is less data to
be written. Actually the message is not delivered in full, and the
remaining part is not sent.
With asynchronous calls the fullness of sending the message to a socket was controlled by the cycle.
To ensure a full send with the synchronous calls added method write_all for a
synchronous write to a socket that uses socket.sendall().
Switch socket from non-blocking mode before synchronous write.

Using socket.sendall() with socket in non-blocking mode leads to EAGAIN.
Up default timeout for synchronous operations to 2 sec. It is necessary
to upload large applications (test on 640Mb archive) with cocaine-tool.
Update setup.py

Don't forget to update version in setup.py
Fixed an error that occurred while processing multiple sessions of the
same events.

The error was related to the fact that objects containing context, are
not copied, but were common. This led to the fact that when the
asynchronous operation of objects may spoil the context of others. Now
the object that holds the context of the session, is created each time
it is started and unique.
Change decorators (http and fs)

Now decorators patch only request object. This allows us to interpret
the result of a request from a cocaine-runtime as an object with any set
of properties.

For example, now http-request has properties: body, meta,
request:

@http
def some_http_event_handler(request, response):
    """ curl -v "http://somehost.ru/some/handle/?a=1&b=2 """"
    req = request.read()
    body = req.body # Body - empty in example

    meta = req.meta
    method = meta['method']  # GET

    request_params = req.request # { "a" : "1", "b" : "2" }

PS. Full description of "meta" see in cocaine/decorators/http.py
Add log message, when handler is absent for giving event.

Write message with warning level.
Adapt for msgpack newer than 0.1

In msgpack there is difference in the unpacking of data into tuple
or list in some versions. Service socket endpoint is receievd as msgpack
object and sometimes unpacked as tuple or list, socket AF_INET
must receive endpoint as tuple, so we always convert endpoint to tuple.
Fixed name of a class that implements event loop.

While services had not been implemented, event loop class was called
Service (in asio/ev.py). Now this name is incorrect, so rename this class to Loop.
future work
Remake future object in services methods.

This is a part of work for supporting on_done() callbacks and supporting
streaming services.
New future in service's methods: support on_done callback.

Now you are able to receive on_done callback in cases, when service
method sends only choke (not even one chunk). Also requesting chunk
after the end of chunk's stream doesn't raise RequestError now, but call
on_done callback(). In coroutine style on_done callback is
generator.send(None), so you will receive only None instead of chunk, if
stream is over. And, for example, storage.wriet() sends only choke in
answer.
Example:
    @http
    def work(request, response):
        req_fut = request.read()
        req = yield req_fut # read request from cloud

        st_future = s.read("manifests", "test")
        test_file = yield st_future # test_file
        yet_data = yield st_future # yet_data - None, stream is over

        st_write_future = s.write("test", "test", "test", [])
        # if operation'll fail - raise ServiceError
        try:
            on_done = yield st_write_future # on_done - None
        except ServiceError as err:
            log.error(str(err))
            response.write_head(200, DEFAULT_HEADERS)
            response.write("Error")
            response.close()
        else:
            response.write_head(200, DEFAULT_HEADERS)
            response.write("Write succesfully")
            response.close()
Add Sleep future.

Example:
from cocaine.futures import Sleep
from cocaine.logging import Logger

l = Logger()

def work(request, response):
    l.info(str(time.time()))
    s_future = Sleep(0.5)
    wake = yield s_future # return after 0.5 sec
    l.info(str(time.time()))
    wake = yield s_future # return after 0.5 sec again
    l.info(str(time.time()))
    response.write("OK")
    response.close()
Add NextTick future.

Allow to attach callback, which will be executed on the next iteration of reactor loop.
It's usefull for long operations in handler, using that from handle
to avoid event loop blocking, like in RubyEventMachine.

example:

from cocaine.futures import NextTick

def main(request, response):
    yield NextTick()
Add optional arguments in Worker() for tuning hearbeat and disown
timeouts.

Example:
W = Worker(disown_timeout=10, heartbeat_timeout=10)
Add supprot for --locator option

if many cocaine-runtime daemons are working on the same node, they have
different locator ports, so worker takes locator port in sys.argv as
--locator option