http.c: in case of error, call on_data callback from complete_callback

Change-Id: I50a9a9e663e20297e75f0b398cbd4adfb2e3a900
Reviewed-on: http://review.couchbase.org/23498
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Return updated error message in Couchbase::Error::HTTP

Change-Id: I6326b60a6e811dcd88114fd74927e5868b91b30b
Reviewed-on: http://review.couchbase.org/23569
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
http.c: free context in async mode

Change-Id: I0622c10bb93d5794f5f7871135bd64aceecc48b2
Reviewed-on: http://review.couchbase.org/23499
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
http.c: in case when connection unsuccessful, cancel request

Change-Id: Ifcf168cc7bd8496a99407ca1d9f5357e36553d7e
Reviewed-on: http://review.couchbase.org/23528
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
http.c: raise error if bucket is not connected

Change-Id: I21782cad7fa8d5f74ac950033899515fc7f1b9bd
Reviewed-on: http://review.couchbase.org/23536
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Get back loop in the View fetcher

Change-Id: I4b86184226e995c91402cf8422f200d20f507d39
Reviewed-on: http://review.couchbase.org/23473
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
context.c: fix error with marking a deleted context

Change-Id: I80079eaab015f6b0e248dd592616c3606b49120e
Reviewed-on: http://review.couchbase.org/23502
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
mth plugin: make it immune from being forgotten

allocate temporary structures as ruby objects, so that it will
be collected even if it's forgotten inside of fiber.

Change-Id: Ia8576f1790f208826d3f8fa06f2a2c19f5bd2074
Reviewed-on: http://review.couchbase.org/23529
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Enable to pick IO engines explicitly

Change-Id: I4b7bf3c1b8cfa1ac939da73dcc0039219575acd4
Reviewed-on: http://review.couchbase.org/23654
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Event machine plugin

Introduce plugin which allows to use couchbase client via same blocking
interface using Ruby 1.9.3 fibers.

Change-Id: I6a5bd7c86f9ce5f3b7090b0c58bc411d6b6a52f7
EM: allow initially asynchronous connections using callback on connection.

Allow :async option to be set on bucket creation if engine is :eventmachine.
User should assign on_connect callback to know when connection were
established or error had occured.

View is not adapted for async connection yet.

Change-Id: I0d0f561522ba71666d340887f8021e58c07f57d3