/* Generated by Cython 0.29.24 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "name": "chorde.clients.async", 
        "sources": [
            "lib/chorde/clients/async.py"
        ]
    }, 
    "module_name": "chorde.clients.async"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_24"
#define CYTHON_HEX_VERSION 0x001D18F0
#define CYTHON_FUTURE_DIVISION 0
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__chorde__clients__async
#define __PYX_HAVE_API__chorde__clients__async
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "lib/chorde/clients/async.py",
};

/*--- Type declarations ---*/
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf;
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults4;
typedef struct __pyx_defaults4 __pyx_defaults4;
struct __pyx_defaults5;
typedef struct __pyx_defaults5 __pyx_defaults5;
struct __pyx_defaults6;
typedef struct __pyx_defaults6 __pyx_defaults6;
struct __pyx_defaults7;
typedef struct __pyx_defaults7 __pyx_defaults7;
struct __pyx_defaults8;
typedef struct __pyx_defaults8 __pyx_defaults8;
struct __pyx_defaults9;
typedef struct __pyx_defaults9 __pyx_defaults9;
struct __pyx_defaults10;
typedef struct __pyx_defaults10 __pyx_defaults10;
struct __pyx_defaults11;
typedef struct __pyx_defaults11 __pyx_defaults11;
struct __pyx_defaults12;
typedef struct __pyx_defaults12 __pyx_defaults12;
struct __pyx_defaults13;
typedef struct __pyx_defaults13 __pyx_defaults13;
struct __pyx_defaults14;
typedef struct __pyx_defaults14 __pyx_defaults14;
struct __pyx_defaults15;
typedef struct __pyx_defaults15 __pyx_defaults15;
struct __pyx_defaults16;
typedef struct __pyx_defaults16 __pyx_defaults16;
struct __pyx_defaults17;
typedef struct __pyx_defaults17 __pyx_defaults17;
struct __pyx_defaults18;
typedef struct __pyx_defaults18 __pyx_defaults18;
struct __pyx_defaults19;
typedef struct __pyx_defaults19 __pyx_defaults19;
struct __pyx_defaults20;
typedef struct __pyx_defaults20 __pyx_defaults20;
struct __pyx_defaults21;
typedef struct __pyx_defaults21 __pyx_defaults21;
struct __pyx_defaults {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_isinstance;
  PyObject *__pyx_arg_getattr;
  PyObject *__pyx_arg_hasattr;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_default;
  PyObject *__pyx_arg__DELETE;
  PyObject *__pyx_arg__EXPIRE;
  PyObject *__pyx_arg__RENEW;
  PyObject *__pyx_arg__CLEAR;
  PyObject *__pyx_arg_NONE;
  PyObject *__pyx_arg__NONE;
  PyObject *__pyx_arg_hasattr;
};
struct __pyx_defaults4 {
  PyObject *__pyx_arg_default;
  PyObject *__pyx_arg__DELETE;
  PyObject *__pyx_arg__EXPIRE;
  PyObject *__pyx_arg__RENEW;
  PyObject *__pyx_arg__CLEAR;
  PyObject *__pyx_arg_NONE;
  PyObject *__pyx_arg__NONE;
  PyObject *__pyx_arg_hasattr;
};
struct __pyx_defaults5 {
  PyObject *__pyx_arg_default;
  PyObject *__pyx_arg__DELETE;
  PyObject *__pyx_arg__EXPIRE;
  PyObject *__pyx_arg__RENEW;
  PyObject *__pyx_arg__CLEAR;
  PyObject *__pyx_arg_NONE;
  PyObject *__pyx_arg__NONE;
  PyObject *__pyx_arg_hasattr;
};
struct __pyx_defaults6 {
  PyObject *__pyx_arg_default;
  PyObject *__pyx_arg__DELETE;
  PyObject *__pyx_arg__EXPIRE;
  PyObject *__pyx_arg__RENEW;
  PyObject *__pyx_arg__CLEAR;
  PyObject *__pyx_arg_NONE;
  PyObject *__pyx_arg__NONE;
  PyObject *__pyx_arg_hasattr;
};
struct __pyx_defaults7 {
  PyObject *__pyx_arg_hasattr;
  PyObject *__pyx_arg_tuple;
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults8 {
  PyObject *__pyx_arg_hasattr;
  PyObject *__pyx_arg_tuple;
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults9 {
  PyObject *__pyx_arg_hasattr;
};
struct __pyx_defaults10 {
  PyObject *__pyx_arg_hasattr;
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults11 {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults12 {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults13 {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults14 {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults15 {
  PyObject *__pyx_arg_getattr;
};
struct __pyx_defaults16 {
  PyObject *__pyx_arg_hasattr;
  PyObject *__pyx_arg_getattr;
  PyObject *__pyx_arg_isinstance;
};
struct __pyx_defaults17 {
  PyObject *__pyx_arg_coalesce_key;
};
struct __pyx_defaults18 {
  PyObject *__pyx_arg_default;
};
struct __pyx_defaults19 {
  PyObject *__pyx_arg_default;
};
struct __pyx_defaults20 {
  PyObject *__pyx_arg_default;
};
struct __pyx_defaults21 {
  PyObject *__pyx_arg_default;
};

/* "chorde/clients/async.py":739
 *         return self.client.get(key, default, ttl_skip = ttl_skip, **kw)
 * 
 *     def getTtlMulti(self, keys, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti {
  PyObject_HEAD
  PyObject *__pyx_v_NONE;
  PyObject *__pyx_v__;
  PyObject *__pyx_v__CLEAR;
  PyObject *__pyx_v__DELETE;
  PyObject *__pyx_v__EXPIRE;
  PyObject *__pyx_v__NONE;
  PyObject *__pyx_v__RENEW;
  PyObject *__pyx_v_default;
  PyObject *__pyx_v_default_rv;
  PyObject *__pyx_v_ettl;
  PyObject *__pyx_v_ettlget;
  PyObject *__pyx_v_hasattr;
  PyObject *__pyx_v_key;
  PyObject *__pyx_v_keys;
  PyObject *__pyx_v_kw;
  PyObject *__pyx_v_nkeys;
  PyObject *__pyx_v_nkeys_append;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_ttl;
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_wgetTtl;
  PyObject *__pyx_v_writer;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "chorde/clients/async.py":787
 *             yield key, (value, ttl)
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti {
  PyObject_HEAD
  PyObject *__pyx_v_NONE;
  PyObject *__pyx_v__;
  PyObject *__pyx_v__CLEAR;
  PyObject *__pyx_v__DELETE;
  PyObject *__pyx_v__EXPIRE;
  PyObject *__pyx_v__NONE;
  PyObject *__pyx_v__RENEW;
  PyObject *__pyx_v_default;
  PyObject *__pyx_v_ettl;
  PyObject *__pyx_v_ettl_append;
  PyObject *__pyx_v_hasattr;
  PyObject *__pyx_v_key;
  PyObject *__pyx_v_keys;
  PyObject *__pyx_v_kw;
  PyObject *__pyx_v_nkeys;
  PyObject *__pyx_v_nkeys_append;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_ttl;
  PyObject *__pyx_v_ttl_skip;
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_wgetTtl;
  PyObject *__pyx_v_writer;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "chorde/clients/async.py":997
 *             self.exc((type(exception),exception,None))
 * 
 *         def on_value(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When and if the operation completes without exception, the callback
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value {
  PyObject_HEAD
  PyObject *__pyx_v_callback;
};


/* "chorde/clients/async.py":1007
 *             return self._on_stuff(value_callback)
 * 
 *         def on_miss(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in a cache miss, the callback will be invoked
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss {
  PyObject_HEAD
  PyObject *__pyx_v_callback;
};


/* "chorde/clients/async.py":1017
 *             return self._on_stuff(miss_callback)
 * 
 *         def on_exc(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in an exception, the callback will be invoked
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc {
  PyObject_HEAD
  PyObject *__pyx_v_callback;
};


/* "chorde/clients/async.py":1027
 *             return self._on_stuff(exc_callback)
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Handy method to set callbacks for all kinds of results, and it's actually
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any {
  PyObject_HEAD
  PyObject *__pyx_v_on_exc;
  PyObject *__pyx_v_on_miss;
  PyObject *__pyx_v_on_value;
};


/* "chorde/clients/async.py":1051
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 *         def on_done(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operation is done, the callback will be invoked without arguments,
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done {
  PyObject_HEAD
  PyObject *__pyx_v_callback;
};


/* "chorde/clients/async.py":1066
 *             self._on_stuff(defer.set)
 * 
 *         def chain_std(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer, without assuming the other
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std {
  PyObject_HEAD
  PyObject *__pyx_v_defer;
};


/* "chorde/clients/async.py":1089
 *             return self
 * 
 *         def add_done_callback(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operatio is done, the callback will be invoked with the
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback {
  PyObject_HEAD
  PyObject *__pyx_v_callback;
  PyObject *__pyx_v_me;
};


/* "chorde/clients/async.py":1235
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):             # <<<<<<<<<<<<<<
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf {
  PyObject_HEAD
  PyObject *__pyx_v_name;
};


/* "chorde/clients/async.py":1365
 *         return self._threadpool
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):             # <<<<<<<<<<<<<<
 *         logger = self.logger
 *         cfuture = future = Future(logger)
 */
struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue {
  PyObject_HEAD
  PyObject *__pyx_v_action;
  PyObject *__pyx_v_cfuture;
  PyObject *__pyx_v_coalesce;
  PyObject *__pyx_v_coalesce_key;
  PyObject *__pyx_v_do_coalescence;
  PyObject *__pyx_v_logger;
  PyObject *__pyx_v_maxqueue;
  PyObject *__pyx_v_queue_time;
  PyObject *__pyx_v_stats;
  PyObject *__pyx_v_wself;
};


/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   (Py_TYPE(obj)->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* CallUnboundCMethod2.proto */
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* py_dict_viewkeys.proto */
#if PY_VERSION_HEX < 0x02070000
#error This module uses dict views, which require Python 2.7 or later
#endif
static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewKeys(PyObject* d);

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* IncludeStringH.proto */
#include <string.h>

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'chorde.clients.async' */
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_1_getMulti = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_2_on_value = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_3_on_miss = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_4_on_exc = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_5_on_any = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_6_on_done = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_7_chain_std = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_9_mkf = 0;
static PyTypeObject *__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_10__enqueue = 0;
#define __Pyx_MODULE_NAME "chorde.clients.async"
extern int __pyx_module_is_main_chorde__clients__async;
int __pyx_module_is_main_chorde__clients__async = 0;

/* Implementation of 'chorde.clients.async' */
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_vars;
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_cb[] = "_cb";
static const char __pyx_k_ev[] = "ev";
static const char __pyx_k_fn[] = "fn";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_kw[] = "kw";
static const char __pyx_k_me[] = "me";
static const char __pyx_k_rv[] = "rv";
static const char __pyx_k_tl[] = "tl";
static const char __pyx_k__29[] = "__";
static const char __pyx_k__75[] = "_";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_cbs[] = "cbs";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_exc[] = "exc";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_kev[] = "kev";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_mkf[] = "mkf";
static const char __pyx_k_old[] = "old";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_put[] = "put";
static const char __pyx_k_ref[] = "ref";
static const char __pyx_k_set[] = "set";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tid[] = "tid";
static const char __pyx_k_ttl[] = "ttl";
static const char __pyx_k_Lock[] = "Lock";
static const char __pyx_k_NONE[] = "_NONE";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_cb_2[] = "cb";
static const char __pyx_k_cbap[] = "cbap";
static const char __pyx_k_ckey[] = "ckey";
static const char __pyx_k_done[] = "done";
static const char __pyx_k_ettl[] = "ettl";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_lazy[] = "lazy";
static const char __pyx_k_lock[] = "_lock";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_miss[] = "miss";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_next[] = "next";
static const char __pyx_k_pool[] = "pool";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_task[] = "task";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_tfin[] = "tfin";
static const char __pyx_k_tidt[] = "tidt";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_vars[] = "vars";
static const char __pyx_k_wait[] = "wait";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_CLEAR[] = "_CLEAR";
static const char __pyx_k_Cache[] = "Cache";
static const char __pyx_k_Defer[] = "Defer";
static const char __pyx_k_Event[] = "Event";
static const char __pyx_k_PURGE[] = "_PURGE";
static const char __pyx_k_REGET[] = "REGET";
static const char __pyx_k_RENEW[] = "_RENEW";
static const char __pyx_k_async[] = "async";
static const char __pyx_k_bound[] = "bound";
static const char __pyx_k_chain[] = "chain";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clean[] = "clean";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_cycle[] = "cycle";
static const char __pyx_k_defer[] = "defer";
static const char __pyx_k_dummy[] = "dummy";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_entry[] = "entry";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_event[] = "event";
static const char __pyx_k_isSet[] = "isSet";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_nkeys[] = "nkeys";
static const char __pyx_k_purge[] = "purge";
static const char __pyx_k_qsize[] = "qsize";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_renew[] = "renew";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_slots[] = "__slots__";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_stats[] = "stats";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tuple[] = "tuple";
static const char __pyx_k_usage[] = "usage";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_wraps[] = "wraps";
static const char __pyx_k_wself[] = "_wself";
static const char __pyx_k_DELETE[] = "_DELETE";
static const char __pyx_k_EXPIRE[] = "_EXPIRE";
static const char __pyx_k_Future[] = "Future";
static const char __pyx_k_NONE_2[] = "NONE";
static const char __pyx_k_action[] = "action";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_cancel[] = "cancel";
static const char __pyx_k_chorde[] = "chorde";
static const char __pyx_k_client[] = "client";
static const char __pyx_k_delete[] = "delete";
static const char __pyx_k_docall[] = "docall";
static const char __pyx_k_expire[] = "expire";
static const char __pyx_k_future[] = "future";
static const char __pyx_k_getTtl[] = "getTtl";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_inproc[] = "inproc";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_on_any[] = "on_any";
static const char __pyx_k_on_exc[] = "on_exc";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_s_of_r[] = "<%s of %r>";
static const char __pyx_k_thread[] = "thread";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_writer[] = "_writer";
static const char __pyx_k_xrange[] = "xrange";
static const char __pyx_k_Process[] = "Process";
static const char __pyx_k_SPECIAL[] = "SPECIAL";
static const char __pyx_k_async_2[] = "_async";
static const char __pyx_k_cfuture[] = "cfuture";
static const char __pyx_k_current[] = "current";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_delayed[] = "delayed";
static const char __pyx_k_dequeue[] = "dequeue";
static const char __pyx_k_enqueue[] = "_enqueue";
static const char __pyx_k_ettlget[] = "ettlget";
static const char __pyx_k_getattr[] = "getattr";
static const char __pyx_k_hasattr[] = "hasattr";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_on_done[] = "on_done";
static const char __pyx_k_on_miss[] = "on_miss";
static const char __pyx_k_partial[] = "partial";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_promote[] = "promote";
static const char __pyx_k_reraise[] = "reraise";
static const char __pyx_k_running[] = "_running";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_tit_tat[] = "_tit_tat";
static const char __pyx_k_undefer[] = "undefer";
static const char __pyx_k_value_2[] = "_value";
static const char __pyx_k_waction[] = "waction";
static const char __pyx_k_waitkey[] = "waitkey";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_weakref[] = "weakref";
static const char __pyx_k_wgetTtl[] = "wgetTtl";
static const char __pyx_k_workers[] = "workers";
static const char __pyx_k_working[] = "working";
static const char __pyx_k_workset[] = "workset";
static const char __pyx_k_wrapped[] = "wrapped";
static const char __pyx_k_wself_2[] = "wself";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_busyloop[] = "busyloop";
static const char __pyx_k_callable[] = "callable_";
static const char __pyx_k_callback[] = "callback";
static const char __pyx_k_capacity[] = "capacity";
static const char __pyx_k_children[] = "_children";
static const char __pyx_k_coalesce[] = "_coalesce";
static const char __pyx_k_contains[] = "__contains__";
static const char __pyx_k_cwaction[] = "cwaction";
static const char __pyx_k_deferred[] = "deferred";
static const char __pyx_k_do_async[] = "do_async";
static const char __pyx_k_drop_one[] = "drop_one";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_getMulti[] = "getMulti";
static const char __pyx_k_logger_2[] = "_logger";
static const char __pyx_k_maxqueue[] = "maxqueue";
static const char __pyx_k_on_stuff[] = "_on_stuff";
static const char __pyx_k_on_value[] = "on_value";
static const char __pyx_k_operator[] = "operator";
static const char __pyx_k_overflow[] = "overflow";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_queuelen[] = "queuelen";
static const char __pyx_k_queueset[] = "queueset";
static const char __pyx_k_ttl_skip[] = "ttl_skip";
static const char __pyx_k_viewkeys[] = "viewkeys";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_writer_2[] = "writer";
static const char __pyx_k_Defer_set[] = "Defer.set";
static const char __pyx_k_cancelled[] = "_cancelled";
static const char __pyx_k_chain_std[] = "chain_std";
static const char __pyx_k_cpu_count[] = "cpu_count";
static const char __pyx_k_enqueue_2[] = "enqueue";
static const char __pyx_k_exception[] = "exception";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_getLogger[] = "getLogger";
static const char __pyx_k_get_ident[] = "get_ident";
static const char __pyx_k_in_worker[] = "in_worker";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_norecurse[] = "norecurse";
static const char __pyx_k_processor[] = "processor";
static const char __pyx_k_queue_ttl[] = "queue_ttl";
static const char __pyx_k_reentrant[] = "reentrant";
static const char __pyx_k_running_2[] = "running";
static const char __pyx_k_serialize[] = "serialize";
static const char __pyx_k_spawnlock[] = "_spawnlock";
static const char __pyx_k_task_time[] = "task_time";
static const char __pyx_k_taskqueue[] = "_taskqueue";
static const char __pyx_k_terminate[] = "terminate";
static const char __pyx_k_thread_id[] = "thread_id";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_threadset[] = "threadset";
static const char __pyx_k_time_time[] = "time_time";
static const char __pyx_k_wait_time[] = "wait_time";
static const char __pyx_k_weakref_2[] = "__weakref__";
static const char __pyx_k_Defer_done[] = "Defer.done";
static const char __pyx_k_Future_exc[] = "Future.exc";
static const char __pyx_k_Future_set[] = "Future.set";
static const char __pyx_k_ThreadPool[] = "ThreadPool";
static const char __pyx_k_clearqueue[] = "clearqueue";
static const char __pyx_k_coalesce_2[] = "coalesce";
static const char __pyx_k_contains_2[] = "_contains";
static const char __pyx_k_contains_3[] = "contains";
static const char __pyx_k_default_rv[] = "default_rv";
static const char __pyx_k_done_event[] = "done_event";
static const char __pyx_k_is_special[] = "is_special";
static const char __pyx_k_is_started[] = "is_started";
static const char __pyx_k_isinstance[] = "isinstance";
static const char __pyx_k_itemgetter[] = "itemgetter";
static const char __pyx_k_itervalues[] = "itervalues";
static const char __pyx_k_queue_time[] = "queue_time";
static const char __pyx_k_set_result[] = "set_result";
static const char __pyx_k_setdefault[] = "setdefault";
static const char __pyx_k_start_time[] = "start_time";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_threadpool[] = "threadpool";
static const char __pyx_k_Future_done[] = "Future.done";
static const char __pyx_k_Future_miss[] = "Future.miss";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_abort_tasks[] = "abort_tasks";
static const char __pyx_k_apply_async[] = "apply_async";
static const char __pyx_k_cancelled_2[] = "cancelled";
static const char __pyx_k_ettl_append[] = "ettl_append";
static const char __pyx_k_getTtlMulti[] = "getTtlMulti";
static const char __pyx_k_on_any_once[] = "on_any_once";
static const char __pyx_k_queue_value[] = "queue_value";
static const char __pyx_k_workset_get[] = "workset_get";
static const char __pyx_k_Defer___init[] = "Defer.__init__";
static const char __pyx_k_Future_chain[] = "Future.chain";
static const char __pyx_k_TimeoutError[] = "TimeoutError";
static const char __pyx_k_chorde_async[] = "chorde.async";
static const char __pyx_k_coalesce_get[] = "coalesce_get";
static const char __pyx_k_coalesce_key[] = "coalesce_key";
static const char __pyx_k_dirty_rounds[] = "dirty_rounds";
static const char __pyx_k_done_event_2[] = "_done_event";
static const char __pyx_k_exc_callback[] = "exc_callback";
static const char __pyx_k_nkeys_append[] = "nkeys_append";
static const char __pyx_k_queue_future[] = "queue_future";
static const char __pyx_k_queue_kwargs[] = "queue_kwargs";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_tasks_queued[] = "tasks_queued";
static const char __pyx_k_threadpool_2[] = "_threadpool";
static const char __pyx_k_Defer_undefer[] = "Defer.undefer";
static const char __pyx_k_Future___init[] = "Future.__init__";
static const char __pyx_k_Future_cancel[] = "Future.cancel";
static const char __pyx_k_Future_on_any[] = "Future.on_any";
static const char __pyx_k_Future_on_exc[] = "Future.on_exc";
static const char __pyx_k_Future_result[] = "Future.result";
static const char __pyx_k_WrapperFuture[] = "WrapperFuture";
static const char __pyx_k_cleanup_tasks[] = "cleanup_tasks";
static const char __pyx_k_done_callback[] = "done_callback";
static const char __pyx_k_exc_nothreads[] = "_exc_nothreads";
static const char __pyx_k_miss_callback[] = "miss_callback";
static const char __pyx_k_renew_undefer[] = "_renew_undefer";
static const char __pyx_k_set_exception[] = "set_exception";
static const char __pyx_k_set_nothreads[] = "_set_nothreads";
static const char __pyx_k_spawning_lock[] = "spawning_lock";
static const char __pyx_k_task_time_max[] = "task_time_max";
static const char __pyx_k_task_time_min[] = "task_time_min";
static const char __pyx_k_task_time_sum[] = "task_time_sum";
static const char __pyx_k_tasks_started[] = "tasks_started";
static const char __pyx_k_wait_time_max[] = "wait_time_max";
static const char __pyx_k_wait_time_min[] = "wait_time_min";
static const char __pyx_k_wait_time_sum[] = "wait_time_sum";
static const char __pyx_k_weak_callback[] = "weak_callback";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_CacheMissError[] = "CacheMissError";
static const char __pyx_k_CancelledError[] = "CancelledError";
static const char __pyx_k_Future_on_done[] = "Future.on_done";
static const char __pyx_k_Future_on_miss[] = "Future.on_miss";
static const char __pyx_k_Future_running[] = "Future.running";
static const char __pyx_k_ProcessorStats[] = "ProcessorStats";
static const char __pyx_k_assert_started[] = "assert_started";
static const char __pyx_k_cancel_pending[] = "_cancel_pending";
static const char __pyx_k_clean_coalesce[] = "clean_coalesce";
static const char __pyx_k_cleanup_cycles[] = "cleanup_cycles";
static const char __pyx_k_do_coalescence[] = "do_coalescence";
static const char __pyx_k_miss_nothreads[] = "_miss_nothreads";
static const char __pyx_k_on_task_queued[] = "on_task_queued";
static const char __pyx_k_value_callback[] = "value_callback";
static const char __pyx_k_working_future[] = "working_future";
static const char __pyx_k_wrapped_action[] = "wrapped_action";
static const char __pyx_k_writer_workers[] = "writer_workers";
static const char __pyx_k_BaseCacheClient[] = "BaseCacheClient";
static const char __pyx_k_Future_on_value[] = "Future.on_value";
static const char __pyx_k_coalesce_getTtl[] = "coalesce_getTtl";
static const char __pyx_k_current_process[] = "current_process";
static const char __pyx_k_multiprocessing[] = "multiprocessing";
static const char __pyx_k_on_task_started[] = "on_task_started";
static const char __pyx_k_tasks_cancelled[] = "tasks_cancelled";
static const char __pyx_k_tasks_completed[] = "tasks_completed";
static const char __pyx_k_ExceptionWrapper[] = "ExceptionWrapper";
static const char __pyx_k_Future__on_stuff[] = "Future._on_stuff";
static const char __pyx_k_Future_cancelled[] = "Future.cancelled";
static const char __pyx_k_Future_chain_std[] = "Future.chain_std";
static const char __pyx_k_Future_exception[] = "Future.exception";
static const char __pyx_k_cancel_pending_2[] = "cancel_pending";
static const char __pyx_k_chorde_serialize[] = "chorde.serialize";
static const char __pyx_k_cleaned_coalesce[] = "cleaned_coalesce";
static const char __pyx_k_defer_threadpool[] = "defer_threadpool";
static const char __pyx_k_promote_callback[] = "promote_callback";
static const char __pyx_k_register_cleanup[] = "register_cleanup";
static const char __pyx_k_WeakKeyDictionary[] = "WeakKeyDictionary";
static const char __pyx_k_add_done_callback[] = "add_done_callback";
static const char __pyx_k_chorde_threadpool[] = "chorde.threadpool";
static const char __pyx_k_coalesce_contains[] = "coalesce_contains";
static const char __pyx_k_makeFutureWrapper[] = "makeFutureWrapper";
static const char __pyx_k_on_task_cancelled[] = "on_task_cancelled";
static const char __pyx_k_on_task_completed[] = "on_task_completed";
static const char __pyx_k_writer_queue_size[] = "writer_queue_size";
static const char __pyx_k_writer_threadpool[] = "writer_threadpool";
static const char __pyx_k_Error_deleting_key[] = "Error deleting key";
static const char __pyx_k_Error_expiring_key[] = "Error expiring key";
static const char __pyx_k_Error_renewing_key[] = "Error renewing key";
static const char __pyx_k_Future_on_any_once[] = "Future.on_any_once";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_defer_threadpool_2[] = "_defer_threadpool";
static const char __pyx_k_threadpool_factory[] = "_threadpool_factory";
static const char __pyx_k_AsyncCacheProcessor[] = "AsyncCacheProcessor";
static const char __pyx_k_Error_purging_cache[] = "Error purging cache";
static const char __pyx_k_do_async_coalescent[] = "do_async_coalescent";
static const char __pyx_k_writer_threadpool_2[] = "_writer_threadpool";
static const char __pyx_k_AsyncCacheWriterPool[] = "AsyncCacheWriterPool";
static const char __pyx_k_Error_clearing_cache[] = "Error clearing cache";
static const char __pyx_k_Error_during_cleanup[] = "Error during cleanup";
static const char __pyx_k_Future_set_exception[] = "Future.set_exception";
static const char __pyx_k_ProcessorStats_reset[] = "ProcessorStats.reset";
static const char __pyx_k_chorde_clients_async[] = "chorde.clients.async";
static const char __pyx_k_global_cleanup_tasks[] = "_global_cleanup_tasks";
static const char __pyx_k_multiprocessing_pool[] = "multiprocessing.pool";
static const char __pyx_k_AsyncWriteCacheClient[] = "AsyncWriteCacheClient";
static const char __pyx_k_Future__exc_nothreads[] = "Future._exc_nothreads";
static const char __pyx_k_Future__set_nothreads[] = "Future._set_nothreads";
static const char __pyx_k_Future_cancel_pending[] = "Future.cancel_pending";
static const char __pyx_k_ProcessorStats___init[] = "ProcessorStats.__init__";
static const char __pyx_k_WrappedCacheProcessor[] = "WrappedCacheProcessor";
static const char __pyx_k_multiprocessing_dummy[] = "multiprocessing.dummy";
static const char __pyx_k_AsyncCacheWriterThread[] = "AsyncCacheWriterThread";
static const char __pyx_k_COALESCE_IGNORE_KWARGS[] = "COALESCE_IGNORE_KWARGS";
static const char __pyx_k_Future__miss_nothreads[] = "Future._miss_nothreads";
static const char __pyx_k_WrapperFuture__wrapped[] = "_WrapperFuture__wrapped";
static const char __pyx_k_AsyncCacheProcessor_add[] = "AsyncCacheProcessor.add";
static const char __pyx_k_AsyncCacheProcessor_get[] = "AsyncCacheProcessor.get";
static const char __pyx_k_AsyncCacheProcessor_put[] = "AsyncCacheProcessor.put";
static const char __pyx_k_Error_in_async_callback[] = "Error in async callback";
static const char __pyx_k_ExceptionWrapper___init[] = "ExceptionWrapper.__init__";
static const char __pyx_k_coalescence_buffer_size[] = "coalescence_buffer_size";
static const char __pyx_k_AsyncCacheWriterPool_put[] = "AsyncCacheWriterPool.put";
static const char __pyx_k_ExceptionWrapper_reraise[] = "ExceptionWrapper.reraise";
static const char __pyx_k_Future_add_done_callback[] = "Future.add_done_callback";
static const char __pyx_k_defer_threadpool_factory[] = "_defer_threadpool_factory";
static const char __pyx_k_register_default_cleanup[] = "register_default_cleanup";
static const char __pyx_k_AsyncCacheProcessorThread[] = "AsyncCacheProcessorThread";
static const char __pyx_k_AsyncCacheProcessor_bound[] = "AsyncCacheProcessor.bound";
static const char __pyx_k_AsyncCacheProcessor_clear[] = "AsyncCacheProcessor.clear";
static const char __pyx_k_AsyncCacheProcessor_purge[] = "AsyncCacheProcessor.purge";
static const char __pyx_k_AsyncCacheProcessor_renew[] = "AsyncCacheProcessor.renew";
static const char __pyx_k_AsyncCacheProcessor_usage[] = "AsyncCacheProcessor.usage";
static const char __pyx_k_AsyncWriteCacheClient_get[] = "AsyncWriteCacheClient.get";
static const char __pyx_k_AsyncWriteCacheClient_put[] = "AsyncWriteCacheClient.put";
static const char __pyx_k_WrappedCacheProcessor_add[] = "WrappedCacheProcessor.add";
static const char __pyx_k_WrappedCacheProcessor_get[] = "WrappedCacheProcessor.get";
static const char __pyx_k_WrappedCacheProcessor_put[] = "WrappedCacheProcessor.put";
static const char __pyx_k_writer_threadpool_factory[] = "_writer_threadpool_factory";
static const char __pyx_k_AsyncCacheProcessor___init[] = "AsyncCacheProcessor.__init__";
static const char __pyx_k_AsyncCacheProcessor_delete[] = "AsyncCacheProcessor.delete";
static const char __pyx_k_AsyncCacheProcessor_expire[] = "AsyncCacheProcessor.expire";
static const char __pyx_k_AsyncCacheProcessor_getTtl[] = "AsyncCacheProcessor.getTtl";
static const char __pyx_k_AsyncCacheWriterPool_clear[] = "AsyncCacheWriterPool.clear";
static const char __pyx_k_AsyncCacheWriterPool_purge[] = "AsyncCacheWriterPool.purge";
static const char __pyx_k_AsyncCacheWriterPool_renew[] = "AsyncCacheWriterPool.renew";
static const char __pyx_k_AsyncCacheWriterPool_usage[] = "AsyncCacheWriterPool.usage";
static const char __pyx_k_AsyncCacheWriterThreadPool[] = "AsyncCacheWriterThreadPool";
static const char __pyx_k_AsyncWriteCacheClient_stop[] = "AsyncWriteCacheClient.stop";
static const char __pyx_k_AsyncWriteCacheClient_wait[] = "AsyncWriteCacheClient.wait";
static const char __pyx_k_AsyncCacheWriterPool___init[] = "AsyncCacheWriterPool.__init__";
static const char __pyx_k_AsyncCacheWriterPool_delete[] = "AsyncCacheWriterPool.delete";
static const char __pyx_k_AsyncCacheWriterPool_expire[] = "AsyncCacheWriterPool.expire";
static const char __pyx_k_AsyncCacheWriterPool_getTtl[] = "AsyncCacheWriterPool.getTtl";
static const char __pyx_k_AsyncWriteCacheClient___str[] = "AsyncWriteCacheClient.__str__";
static const char __pyx_k_AsyncWriteCacheClient_async[] = "AsyncWriteCacheClient.async";
static const char __pyx_k_AsyncWriteCacheClient_clear[] = "AsyncWriteCacheClient.clear";
static const char __pyx_k_AsyncWriteCacheClient_purge[] = "AsyncWriteCacheClient.purge";
static const char __pyx_k_AsyncWriteCacheClient_renew[] = "AsyncWriteCacheClient.renew";
static const char __pyx_k_AsyncWriteCacheClient_start[] = "AsyncWriteCacheClient.start";
static const char __pyx_k_AsyncWriteCacheClient_usage[] = "AsyncWriteCacheClient.usage";
static const char __pyx_k_WrappedCacheProcessor_bound[] = "WrappedCacheProcessor.bound";
static const char __pyx_k_WrappedCacheProcessor_clear[] = "WrappedCacheProcessor.clear";
static const char __pyx_k_WrappedCacheProcessor_purge[] = "WrappedCacheProcessor.purge";
static const char __pyx_k_WrappedCacheProcessor_renew[] = "WrappedCacheProcessor.renew";
static const char __pyx_k_WrappedCacheProcessor_stats[] = "WrappedCacheProcessor.stats";
static const char __pyx_k_WrappedCacheProcessor_usage[] = "WrappedCacheProcessor.usage";
static const char __pyx_k_lib_chorde_clients_async_py[] = "lib/chorde/clients/async.py";
static const char __pyx_k_AsyncCacheProcessor__enqueue[] = "AsyncCacheProcessor._enqueue";
static const char __pyx_k_AsyncCacheProcessor_capacity[] = "AsyncCacheProcessor.capacity";
static const char __pyx_k_AsyncCacheProcessor_contains[] = "AsyncCacheProcessor.contains";
static const char __pyx_k_AsyncCacheProcessor_do_async[] = "AsyncCacheProcessor.do_async";
static const char __pyx_k_AsyncCacheProcessor_queuelen[] = "AsyncCacheProcessor.queuelen";
static const char __pyx_k_AsyncCacheWriterPool__writer[] = "AsyncCacheWriterPool._writer";
static const char __pyx_k_AsyncCacheWriterPool_dequeue[] = "AsyncCacheWriterPool.dequeue";
static const char __pyx_k_AsyncCacheWriterPool_enqueue[] = "AsyncCacheWriterPool.enqueue";
static const char __pyx_k_AsyncCacheWriterPool_waitkey[] = "AsyncCacheWriterPool.waitkey";
static const char __pyx_k_AsyncWriteCacheClient___init[] = "AsyncWriteCacheClient.__init__";
static const char __pyx_k_AsyncWriteCacheClient___repr[] = "AsyncWriteCacheClient.__repr__";
static const char __pyx_k_AsyncWriteCacheClient_delete[] = "AsyncWriteCacheClient.delete";
static const char __pyx_k_AsyncWriteCacheClient_expire[] = "AsyncWriteCacheClient.expire";
static const char __pyx_k_AsyncWriteCacheClient_getTtl[] = "AsyncWriteCacheClient.getTtl";
static const char __pyx_k_WrappedCacheProcessor___init[] = "WrappedCacheProcessor.__init__";
static const char __pyx_k_WrappedCacheProcessor_delete[] = "WrappedCacheProcessor.delete";
static const char __pyx_k_WrappedCacheProcessor_expire[] = "WrappedCacheProcessor.expire";
static const char __pyx_k_WrappedCacheProcessor_getTtl[] = "WrappedCacheProcessor.getTtl";
static const char __pyx_k_AsyncCacheProcessorThreadPool[] = "AsyncCacheProcessorThreadPool";
static const char __pyx_k_AsyncCacheWriterPool__enqueue[] = "AsyncCacheWriterPool._enqueue";
static const char __pyx_k_AsyncCacheWriterPool_capacity[] = "AsyncCacheWriterPool.capacity";
static const char __pyx_k_AsyncCacheWriterPool_contains[] = "AsyncCacheWriterPool.contains";
static const char __pyx_k_AsyncCacheWriterPool_drop_one[] = "AsyncCacheWriterPool.drop_one";
static const char __pyx_k_AsyncWriteCacheClient_promote[] = "AsyncWriteCacheClient.promote";
static const char __pyx_k_Future_on_any_locals_callback[] = "Future.on_any.<locals>.callback";
static const char __pyx_k_ProcessorStats_on_task_queued[] = "ProcessorStats.on_task_queued";
static const char __pyx_k_AsyncCacheProcessor_threadpool[] = "AsyncCacheProcessor.threadpool";
static const char __pyx_k_AsyncCacheWriterPool__coalesce[] = "AsyncCacheWriterPool._coalesce";
static const char __pyx_k_AsyncCacheWriterPool__contains[] = "AsyncCacheWriterPool._contains";
static const char __pyx_k_AsyncWriteCacheClient_capacity[] = "AsyncWriteCacheClient.capacity";
static const char __pyx_k_AsyncWriteCacheClient_contains[] = "AsyncWriteCacheClient.contains";
static const char __pyx_k_AsyncWriteCacheClient_getMulti[] = "AsyncWriteCacheClient.getMulti";
static const char __pyx_k_Future_chain_std_locals_lambda[] = "Future.chain_std.<locals>.<lambda>";
static const char __pyx_k_ProcessorStats_on_task_started[] = "ProcessorStats.on_task_started";
static const char __pyx_k_WrappedCacheProcessor_capacity[] = "WrappedCacheProcessor.capacity";
static const char __pyx_k_WrappedCacheProcessor_contains[] = "WrappedCacheProcessor.contains";
static const char __pyx_k_WrappedCacheProcessor_do_async[] = "WrappedCacheProcessor.do_async";
static const char __pyx_k_WrappedCacheProcessor_maxqueue[] = "WrappedCacheProcessor.maxqueue";
static const char __pyx_k_WrappedCacheProcessor_queuelen[] = "WrappedCacheProcessor.queuelen";
static const char __pyx_k_An_async_cache_processor_will_a[] = "\n    An async cache processor will allow asynchronous reads\n    and writes to a cache, Efficiently fitting into an async\n    framework by passing and invoking callbacks.\n\n    It modifies the cache interface to return a Future\n    instead of a value, upon which an on_value(callback)\n    method will retrieve the result, if any.\n\n    If there is a cache miss, on_miss callbacks will be invoked\n    instead, and in case of an exception, on_exc.\n\n    Futures also implement Python 3's concurrent.futures.Future\n    interface, see Future's documentation for more details.\n\n    It also provides a do_async, that lets you dump arbitrary\n    tasks on this processor's async processing pool (in case\n    you need to do it for synchronization)\n    ";
static const char __pyx_k_AsyncCacheProcessorThreadPool_2[] = "AsyncCacheProcessorThreadPool.__init__";
static const char __pyx_k_AsyncCacheWriterPool_clearqueue[] = "AsyncCacheWriterPool.clearqueue";
static const char __pyx_k_Future_add_done_callback_locals[] = "Future.add_done_callback.<locals>.weak_callback";
static const char __pyx_k_Starting_AsyncCacheClient_twice[] = "Starting AsyncCacheClient twice";
static const char __pyx_k_Wrap_a_callable_in_this_and_pas[] = "\n    Wrap a callable in this, and pass it as a value to an AsyncWriteCacheClient,\n    and the evaluation of the given callable will happen asynchronously. The cache\n    will return stale entries until the callable is finished computing a new value.\n\n    If a future attribute is attached, this defer will act as executioner of that\n    future, and both set_running_or_notify_cancelled and set_result or set_exception\n    will be called on it.\n\n    If a future is attached during execution, set_running_or_notify_cancelled will\n    not be invoked, but set_result will.\n    ";
static const char __pyx_k_Wraps_an_AsyncCacheProcessor_bi[] = "\n    Wraps an AsyncCacheProcessor, binding its interface to a\n    different client.\n    ";
static const char __pyx_k_async_extension_module_not_buil[] = "_async extension module not built in, using pure-python version which is not atomic and requiresexplicit synchronization. Decreased performance will be noticeable";
static const char __pyx_k_set_running_or_notify_cancelled[] = "set_running_or_notify_cancelled";
static const char __pyx_k_AsyncCacheProcessorThreadPool_As[] = "AsyncCacheProcessorThreadPool.AsyncCacheProcessorThread";
static const char __pyx_k_AsyncCacheProcessor__enqueue_loc[] = "AsyncCacheProcessor._enqueue.<locals>.wrapped_action.<locals>.clean_coalesce";
static const char __pyx_k_AsyncCacheProcessor_do_async_coa[] = "AsyncCacheProcessor.do_async_coalescent";
static const char __pyx_k_AsyncCacheProcessor_register_cle[] = "AsyncCacheProcessor.register_cleanup";
static const char __pyx_k_AsyncCacheProcessor_register_def[] = "AsyncCacheProcessor.register_default_cleanup";
static const char __pyx_k_AsyncCacheWriterPool_defer_threa[] = "AsyncCacheWriterPool.defer_threadpool";
static const char __pyx_k_AsyncCacheWriterPool_register_cl[] = "AsyncCacheWriterPool.register_cleanup";
static const char __pyx_k_AsyncCacheWriterPool_register_de[] = "AsyncCacheWriterPool.register_default_cleanup";
static const char __pyx_k_AsyncCacheWriterPool_writer_thre[] = "AsyncCacheWriterPool.writer_threadpool";
static const char __pyx_k_AsyncCacheWriterThreadPool_Async[] = "AsyncCacheWriterThreadPool.AsyncCacheWriterThread";
static const char __pyx_k_AsyncCacheWriterThreadPool___ini[] = "AsyncCacheWriterThreadPool.__init__";
static const char __pyx_k_AsyncWriteCacheClient_assert_sta[] = "AsyncWriteCacheClient.assert_started";
static const char __pyx_k_AsyncWriteCacheClient_getTtlMult[] = "AsyncWriteCacheClient.getTtlMulti";
static const char __pyx_k_AsyncWriteCacheClient_is_started[] = "AsyncWriteCacheClient.is_started";
static const char __pyx_k_AsyncWriteCacheClient_register_c[] = "AsyncWriteCacheClient.register_cleanup";
static const char __pyx_k_Error_during_background_thread_c[] = "Error during background thread cleanup";
static const char __pyx_k_Error_in_background_cache_refres[] = "Error in background cache refresh";
static const char __pyx_k_Error_saving_data_in_cache_r_key[] = "Error saving data in cache %r, key %r";
static const char __pyx_k_Found_zombie_task_in_coalesce_bu[] = "Found zombie task in coalesce buffer with key %r";
static const char __pyx_k_Future_on_done_locals_done_callb[] = "Future.on_done.<locals>.done_callback";
static const char __pyx_k_Future_on_exc_locals_exc_callbac[] = "Future.on_exc.<locals>.exc_callback";
static const char __pyx_k_Future_on_miss_locals_miss_callb[] = "Future.on_miss.<locals>.miss_callback";
static const char __pyx_k_Future_on_value_locals_value_cal[] = "Future.on_value.<locals>.value_callback";
static const char __pyx_k_Future_set_running_or_notify_can[] = "Future.set_running_or_notify_cancelled";
static const char __pyx_k_ProcessorStats_on_task_cancelled[] = "ProcessorStats.on_task_cancelled";
static const char __pyx_k_ProcessorStats_on_task_completed[] = "ProcessorStats.on_task_completed";
static const char __pyx_k_WrappedCacheProcessor_register_c[] = "WrappedCacheProcessor.register_cleanup";
static const char __pyx_k_WrappedCacheProcessor_register_d[] = "WrappedCacheProcessor.register_default_cleanup";
static const char __pyx_k_makeFutureWrapper_locals_Wrapper[] = "makeFutureWrapper.<locals>.WrapperFuture.mkf.<locals>.f";
static const char __pyx_k_AsyncCacheProcessor__enqueue_loc_2[] = "AsyncCacheProcessor._enqueue.<locals>.wrapped_action.<locals>.clean";
static const char __pyx_k_AsyncCacheProcessor__enqueue_loc_3[] = "AsyncCacheProcessor._enqueue.<locals>.wrapped_action";
static const char __pyx_k_makeFutureWrapper_locals_Wrapper_2[] = "makeFutureWrapper.<locals>.WrapperFuture";
static const char __pyx_k_makeFutureWrapper_locals_Wrapper_3[] = "makeFutureWrapper.<locals>.WrapperFuture.__init__";
static const char __pyx_k_makeFutureWrapper_locals_Wrapper_4[] = "makeFutureWrapper.<locals>.WrapperFuture.mkf";
static PyObject *__pyx_kp_s_An_async_cache_processor_will_a;
static PyObject *__pyx_n_s_AssertionError;
static PyObject *__pyx_n_s_AsyncCacheProcessor;
static PyObject *__pyx_n_s_AsyncCacheProcessorThread;
static PyObject *__pyx_n_s_AsyncCacheProcessorThreadPool;
static PyObject *__pyx_n_s_AsyncCacheProcessorThreadPool_2;
static PyObject *__pyx_n_s_AsyncCacheProcessorThreadPool_As;
static PyObject *__pyx_n_s_AsyncCacheProcessor___init;
static PyObject *__pyx_n_s_AsyncCacheProcessor__enqueue;
static PyObject *__pyx_n_s_AsyncCacheProcessor__enqueue_loc;
static PyObject *__pyx_n_s_AsyncCacheProcessor__enqueue_loc_2;
static PyObject *__pyx_n_s_AsyncCacheProcessor__enqueue_loc_3;
static PyObject *__pyx_n_s_AsyncCacheProcessor_add;
static PyObject *__pyx_n_s_AsyncCacheProcessor_bound;
static PyObject *__pyx_n_s_AsyncCacheProcessor_capacity;
static PyObject *__pyx_n_s_AsyncCacheProcessor_clear;
static PyObject *__pyx_n_s_AsyncCacheProcessor_contains;
static PyObject *__pyx_n_s_AsyncCacheProcessor_delete;
static PyObject *__pyx_n_s_AsyncCacheProcessor_do_async;
static PyObject *__pyx_n_s_AsyncCacheProcessor_do_async_coa;
static PyObject *__pyx_n_s_AsyncCacheProcessor_expire;
static PyObject *__pyx_n_s_AsyncCacheProcessor_get;
static PyObject *__pyx_n_s_AsyncCacheProcessor_getTtl;
static PyObject *__pyx_n_s_AsyncCacheProcessor_purge;
static PyObject *__pyx_n_s_AsyncCacheProcessor_put;
static PyObject *__pyx_n_s_AsyncCacheProcessor_queuelen;
static PyObject *__pyx_n_s_AsyncCacheProcessor_register_cle;
static PyObject *__pyx_n_s_AsyncCacheProcessor_register_def;
static PyObject *__pyx_n_s_AsyncCacheProcessor_renew;
static PyObject *__pyx_n_s_AsyncCacheProcessor_threadpool;
static PyObject *__pyx_n_s_AsyncCacheProcessor_usage;
static PyObject *__pyx_n_s_AsyncCacheWriterPool;
static PyObject *__pyx_n_s_AsyncCacheWriterPool___init;
static PyObject *__pyx_n_s_AsyncCacheWriterPool__coalesce;
static PyObject *__pyx_n_s_AsyncCacheWriterPool__contains;
static PyObject *__pyx_n_s_AsyncCacheWriterPool__enqueue;
static PyObject *__pyx_n_s_AsyncCacheWriterPool__writer;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_capacity;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_clear;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_clearqueue;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_contains;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_defer_threa;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_delete;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_dequeue;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_drop_one;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_enqueue;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_expire;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_getTtl;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_purge;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_put;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_register_cl;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_register_de;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_renew;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_usage;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_waitkey;
static PyObject *__pyx_n_s_AsyncCacheWriterPool_writer_thre;
static PyObject *__pyx_n_s_AsyncCacheWriterThread;
static PyObject *__pyx_n_s_AsyncCacheWriterThreadPool;
static PyObject *__pyx_n_s_AsyncCacheWriterThreadPool_Async;
static PyObject *__pyx_n_s_AsyncCacheWriterThreadPool___ini;
static PyObject *__pyx_n_s_AsyncWriteCacheClient;
static PyObject *__pyx_n_s_AsyncWriteCacheClient___init;
static PyObject *__pyx_n_s_AsyncWriteCacheClient___repr;
static PyObject *__pyx_n_s_AsyncWriteCacheClient___str;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_assert_sta;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_async;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_capacity;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_clear;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_contains;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_delete;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_expire;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_get;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_getMulti;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_getTtl;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_getTtlMult;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_is_started;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_promote;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_purge;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_put;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_register_c;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_renew;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_start;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_stop;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_usage;
static PyObject *__pyx_n_s_AsyncWriteCacheClient_wait;
static PyObject *__pyx_n_s_BaseCacheClient;
static PyObject *__pyx_n_s_CLEAR;
static PyObject *__pyx_n_s_COALESCE_IGNORE_KWARGS;
static PyObject *__pyx_n_s_Cache;
static PyObject *__pyx_n_s_CacheMissError;
static PyObject *__pyx_n_s_CancelledError;
static PyObject *__pyx_n_s_DELETE;
static PyObject *__pyx_n_s_Defer;
static PyObject *__pyx_n_s_Defer___init;
static PyObject *__pyx_n_s_Defer_done;
static PyObject *__pyx_n_s_Defer_set;
static PyObject *__pyx_n_s_Defer_undefer;
static PyObject *__pyx_n_s_EXPIRE;
static PyObject *__pyx_kp_s_Error_clearing_cache;
static PyObject *__pyx_kp_s_Error_deleting_key;
static PyObject *__pyx_kp_s_Error_during_background_thread_c;
static PyObject *__pyx_kp_s_Error_during_cleanup;
static PyObject *__pyx_kp_s_Error_expiring_key;
static PyObject *__pyx_kp_s_Error_in_async_callback;
static PyObject *__pyx_kp_s_Error_in_background_cache_refres;
static PyObject *__pyx_kp_s_Error_purging_cache;
static PyObject *__pyx_kp_s_Error_renewing_key;
static PyObject *__pyx_kp_s_Error_saving_data_in_cache_r_key;
static PyObject *__pyx_n_s_Event;
static PyObject *__pyx_n_s_ExceptionWrapper;
static PyObject *__pyx_n_s_ExceptionWrapper___init;
static PyObject *__pyx_n_s_ExceptionWrapper_reraise;
static PyObject *__pyx_kp_s_Found_zombie_task_in_coalesce_bu;
static PyObject *__pyx_n_s_Future;
static PyObject *__pyx_n_s_Future___init;
static PyObject *__pyx_n_s_Future__exc_nothreads;
static PyObject *__pyx_n_s_Future__miss_nothreads;
static PyObject *__pyx_n_s_Future__on_stuff;
static PyObject *__pyx_n_s_Future__set_nothreads;
static PyObject *__pyx_n_s_Future_add_done_callback;
static PyObject *__pyx_n_s_Future_add_done_callback_locals;
static PyObject *__pyx_n_s_Future_cancel;
static PyObject *__pyx_n_s_Future_cancel_pending;
static PyObject *__pyx_n_s_Future_cancelled;
static PyObject *__pyx_n_s_Future_chain;
static PyObject *__pyx_n_s_Future_chain_std;
static PyObject *__pyx_n_s_Future_chain_std_locals_lambda;
static PyObject *__pyx_n_s_Future_done;
static PyObject *__pyx_n_s_Future_exc;
static PyObject *__pyx_n_s_Future_exception;
static PyObject *__pyx_n_s_Future_miss;
static PyObject *__pyx_n_s_Future_on_any;
static PyObject *__pyx_n_s_Future_on_any_locals_callback;
static PyObject *__pyx_n_s_Future_on_any_once;
static PyObject *__pyx_n_s_Future_on_done;
static PyObject *__pyx_n_s_Future_on_done_locals_done_callb;
static PyObject *__pyx_n_s_Future_on_exc;
static PyObject *__pyx_n_s_Future_on_exc_locals_exc_callbac;
static PyObject *__pyx_n_s_Future_on_miss;
static PyObject *__pyx_n_s_Future_on_miss_locals_miss_callb;
static PyObject *__pyx_n_s_Future_on_value;
static PyObject *__pyx_n_s_Future_on_value_locals_value_cal;
static PyObject *__pyx_n_s_Future_result;
static PyObject *__pyx_n_s_Future_running;
static PyObject *__pyx_n_s_Future_set;
static PyObject *__pyx_n_s_Future_set_exception;
static PyObject *__pyx_n_s_Future_set_running_or_notify_can;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_Lock;
static PyObject *__pyx_n_s_NONE;
static PyObject *__pyx_n_s_NONE_2;
static PyObject *__pyx_n_s_PURGE;
static PyObject *__pyx_n_s_Process;
static PyObject *__pyx_n_s_ProcessorStats;
static PyObject *__pyx_n_s_ProcessorStats___init;
static PyObject *__pyx_n_s_ProcessorStats_on_task_cancelled;
static PyObject *__pyx_n_s_ProcessorStats_on_task_completed;
static PyObject *__pyx_n_s_ProcessorStats_on_task_queued;
static PyObject *__pyx_n_s_ProcessorStats_on_task_started;
static PyObject *__pyx_n_s_ProcessorStats_reset;
static PyObject *__pyx_n_s_REGET;
static PyObject *__pyx_n_s_RENEW;
static PyObject *__pyx_n_s_SPECIAL;
static PyObject *__pyx_kp_s_Starting_AsyncCacheClient_twice;
static PyObject *__pyx_n_s_ThreadPool;
static PyObject *__pyx_n_s_TimeoutError;
static PyObject *__pyx_n_s_WeakKeyDictionary;
static PyObject *__pyx_kp_s_Wrap_a_callable_in_this_and_pas;
static PyObject *__pyx_n_s_WrappedCacheProcessor;
static PyObject *__pyx_n_s_WrappedCacheProcessor___init;
static PyObject *__pyx_n_s_WrappedCacheProcessor_add;
static PyObject *__pyx_n_s_WrappedCacheProcessor_bound;
static PyObject *__pyx_n_s_WrappedCacheProcessor_capacity;
static PyObject *__pyx_n_s_WrappedCacheProcessor_clear;
static PyObject *__pyx_n_s_WrappedCacheProcessor_contains;
static PyObject *__pyx_n_s_WrappedCacheProcessor_delete;
static PyObject *__pyx_n_s_WrappedCacheProcessor_do_async;
static PyObject *__pyx_n_s_WrappedCacheProcessor_expire;
static PyObject *__pyx_n_s_WrappedCacheProcessor_get;
static PyObject *__pyx_n_s_WrappedCacheProcessor_getTtl;
static PyObject *__pyx_n_s_WrappedCacheProcessor_maxqueue;
static PyObject *__pyx_n_s_WrappedCacheProcessor_purge;
static PyObject *__pyx_n_s_WrappedCacheProcessor_put;
static PyObject *__pyx_n_s_WrappedCacheProcessor_queuelen;
static PyObject *__pyx_n_s_WrappedCacheProcessor_register_c;
static PyObject *__pyx_n_s_WrappedCacheProcessor_register_d;
static PyObject *__pyx_n_s_WrappedCacheProcessor_renew;
static PyObject *__pyx_n_s_WrappedCacheProcessor_stats;
static PyObject *__pyx_n_s_WrappedCacheProcessor_usage;
static PyObject *__pyx_n_s_WrapperFuture;
static PyObject *__pyx_n_s_WrapperFuture__wrapped;
static PyObject *__pyx_kp_s_Wraps_an_AsyncCacheProcessor_bi;
static PyObject *__pyx_n_s__29;
static PyObject *__pyx_n_s__75;
static PyObject *__pyx_n_s_abort_tasks;
static PyObject *__pyx_n_s_action;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_done_callback;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply_async;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_assert_started;
static PyObject *__pyx_n_s_async;
static PyObject *__pyx_n_s_async_2;
static PyObject *__pyx_kp_s_async_extension_module_not_buil;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bound;
static PyObject *__pyx_n_s_busyloop;
static PyObject *__pyx_n_s_callable;
static PyObject *__pyx_n_s_callback;
static PyObject *__pyx_n_s_cancel;
static PyObject *__pyx_n_s_cancel_pending;
static PyObject *__pyx_n_s_cancel_pending_2;
static PyObject *__pyx_n_s_cancelled;
static PyObject *__pyx_n_s_cancelled_2;
static PyObject *__pyx_n_s_capacity;
static PyObject *__pyx_n_s_cb;
static PyObject *__pyx_n_s_cb_2;
static PyObject *__pyx_n_s_cbap;
static PyObject *__pyx_n_s_cbs;
static PyObject *__pyx_n_s_cfuture;
static PyObject *__pyx_n_s_chain;
static PyObject *__pyx_n_s_chain_std;
static PyObject *__pyx_n_s_children;
static PyObject *__pyx_n_s_chorde;
static PyObject *__pyx_kp_s_chorde_async;
static PyObject *__pyx_n_s_chorde_clients_async;
static PyObject *__pyx_n_s_chorde_serialize;
static PyObject *__pyx_n_s_chorde_threadpool;
static PyObject *__pyx_n_s_ckey;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clean;
static PyObject *__pyx_n_s_clean_coalesce;
static PyObject *__pyx_n_s_cleaned_coalesce;
static PyObject *__pyx_n_s_cleanup_cycles;
static PyObject *__pyx_n_s_cleanup_tasks;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clearqueue;
static PyObject *__pyx_n_s_client;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_coalesce;
static PyObject *__pyx_n_s_coalesce_2;
static PyObject *__pyx_n_s_coalesce_contains;
static PyObject *__pyx_n_s_coalesce_get;
static PyObject *__pyx_n_s_coalesce_getTtl;
static PyObject *__pyx_n_s_coalesce_key;
static PyObject *__pyx_n_s_coalescence_buffer_size;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_n_s_contains_2;
static PyObject *__pyx_n_s_contains_3;
static PyObject *__pyx_n_s_cpu_count;
static PyObject *__pyx_n_s_current;
static PyObject *__pyx_n_s_current_process;
static PyObject *__pyx_n_s_cwaction;
static PyObject *__pyx_n_s_cycle;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_default_rv;
static PyObject *__pyx_n_s_defer;
static PyObject *__pyx_n_s_defer_threadpool;
static PyObject *__pyx_n_s_defer_threadpool_2;
static PyObject *__pyx_n_s_defer_threadpool_factory;
static PyObject *__pyx_n_s_deferred;
static PyObject *__pyx_n_s_delayed;
static PyObject *__pyx_n_s_delete;
static PyObject *__pyx_n_s_dequeue;
static PyObject *__pyx_n_s_dirty_rounds;
static PyObject *__pyx_n_s_do_async;
static PyObject *__pyx_n_s_do_async_coalescent;
static PyObject *__pyx_n_s_do_coalescence;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_docall;
static PyObject *__pyx_n_s_done;
static PyObject *__pyx_n_s_done_callback;
static PyObject *__pyx_n_s_done_event;
static PyObject *__pyx_n_s_done_event_2;
static PyObject *__pyx_n_s_drop_one;
static PyObject *__pyx_n_s_dummy;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_enqueue;
static PyObject *__pyx_n_s_enqueue_2;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_entry;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_ettl;
static PyObject *__pyx_n_s_ettl_append;
static PyObject *__pyx_n_s_ettlget;
static PyObject *__pyx_n_s_ev;
static PyObject *__pyx_n_s_event;
static PyObject *__pyx_n_s_exc;
static PyObject *__pyx_n_s_exc_callback;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_exc_nothreads;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_expire;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_fn;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_s_future;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_getLogger;
static PyObject *__pyx_n_s_getMulti;
static PyObject *__pyx_n_s_getTtl;
static PyObject *__pyx_n_s_getTtlMulti;
static PyObject *__pyx_n_s_get_ident;
static PyObject *__pyx_n_s_getattr;
static PyObject *__pyx_n_s_global_cleanup_tasks;
static PyObject *__pyx_n_s_hasattr;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_worker;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_inproc;
static PyObject *__pyx_n_s_isSet;
static PyObject *__pyx_n_s_is_special;
static PyObject *__pyx_n_s_is_started;
static PyObject *__pyx_n_s_isinstance;
static PyObject *__pyx_n_s_itemgetter;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_itervalues;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_kev;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kw;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_lazy;
static PyObject *__pyx_kp_s_lib_chorde_clients_async_py;
static PyObject *__pyx_n_s_local;
static PyObject *__pyx_n_s_lock;
static PyObject *__pyx_n_s_logger;
static PyObject *__pyx_n_s_logger_2;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_makeFutureWrapper;
static PyObject *__pyx_n_s_makeFutureWrapper_locals_Wrapper;
static PyObject *__pyx_n_s_makeFutureWrapper_locals_Wrapper_2;
static PyObject *__pyx_n_s_makeFutureWrapper_locals_Wrapper_3;
static PyObject *__pyx_n_s_makeFutureWrapper_locals_Wrapper_4;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_maxqueue;
static PyObject *__pyx_n_s_me;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_miss;
static PyObject *__pyx_n_s_miss_callback;
static PyObject *__pyx_n_s_miss_nothreads;
static PyObject *__pyx_n_s_mkf;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_multiprocessing;
static PyObject *__pyx_n_s_multiprocessing_dummy;
static PyObject *__pyx_n_s_multiprocessing_pool;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_nkeys;
static PyObject *__pyx_n_s_nkeys_append;
static PyObject *__pyx_n_s_norecurse;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_old;
static PyObject *__pyx_n_s_on_any;
static PyObject *__pyx_n_s_on_any_once;
static PyObject *__pyx_n_s_on_done;
static PyObject *__pyx_n_s_on_exc;
static PyObject *__pyx_n_s_on_miss;
static PyObject *__pyx_n_s_on_stuff;
static PyObject *__pyx_n_s_on_task_cancelled;
static PyObject *__pyx_n_s_on_task_completed;
static PyObject *__pyx_n_s_on_task_queued;
static PyObject *__pyx_n_s_on_task_started;
static PyObject *__pyx_n_s_on_value;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_overflow;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_partial;
static PyObject *__pyx_n_s_pool;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_processor;
static PyObject *__pyx_n_s_promote;
static PyObject *__pyx_n_s_promote_callback;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_purge;
static PyObject *__pyx_n_s_put;
static PyObject *__pyx_n_s_qsize;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue_future;
static PyObject *__pyx_n_s_queue_kwargs;
static PyObject *__pyx_n_s_queue_time;
static PyObject *__pyx_n_s_queue_ttl;
static PyObject *__pyx_n_s_queue_value;
static PyObject *__pyx_n_s_queuelen;
static PyObject *__pyx_n_s_queueset;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reentrant;
static PyObject *__pyx_n_s_ref;
static PyObject *__pyx_n_s_register_cleanup;
static PyObject *__pyx_n_s_register_default_cleanup;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_renew;
static PyObject *__pyx_n_s_renew_undefer;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_reraise;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_running;
static PyObject *__pyx_n_s_running_2;
static PyObject *__pyx_n_s_rv;
static PyObject *__pyx_kp_s_s_of_r;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_serialize;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_set_exception;
static PyObject *__pyx_n_s_set_nothreads;
static PyObject *__pyx_n_s_set_result;
static PyObject *__pyx_n_s_set_running_or_notify_cancelled;
static PyObject *__pyx_n_s_setdefault;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_slots;
static PyObject *__pyx_n_s_spawning_lock;
static PyObject *__pyx_n_s_spawnlock;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_start_time;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_stats;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_task;
static PyObject *__pyx_n_s_task_time;
static PyObject *__pyx_n_s_task_time_max;
static PyObject *__pyx_n_s_task_time_min;
static PyObject *__pyx_n_s_task_time_sum;
static PyObject *__pyx_n_s_taskqueue;
static PyObject *__pyx_n_s_tasks_cancelled;
static PyObject *__pyx_n_s_tasks_completed;
static PyObject *__pyx_n_s_tasks_queued;
static PyObject *__pyx_n_s_tasks_started;
static PyObject *__pyx_n_s_terminate;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tfin;
static PyObject *__pyx_n_s_thread;
static PyObject *__pyx_n_s_thread_id;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_threadpool;
static PyObject *__pyx_n_s_threadpool_2;
static PyObject *__pyx_n_s_threadpool_factory;
static PyObject *__pyx_n_s_threadset;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tid;
static PyObject *__pyx_n_s_tidt;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time_time;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_tit_tat;
static PyObject *__pyx_n_s_tl;
static PyObject *__pyx_n_s_ttl;
static PyObject *__pyx_n_s_ttl_skip;
static PyObject *__pyx_n_s_tuple;
static PyObject *__pyx_n_s_undefer;
static PyObject *__pyx_n_s_usage;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_value_2;
static PyObject *__pyx_n_s_value_callback;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vars;
static PyObject *__pyx_n_s_viewkeys;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_waction;
static PyObject *__pyx_n_s_wait;
static PyObject *__pyx_n_s_wait_time;
static PyObject *__pyx_n_s_wait_time_max;
static PyObject *__pyx_n_s_wait_time_min;
static PyObject *__pyx_n_s_wait_time_sum;
static PyObject *__pyx_n_s_waitkey;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warning;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_weak_callback;
static PyObject *__pyx_n_s_weakref;
static PyObject *__pyx_n_s_weakref_2;
static PyObject *__pyx_n_s_wgetTtl;
static PyObject *__pyx_n_s_workers;
static PyObject *__pyx_n_s_working;
static PyObject *__pyx_n_s_working_future;
static PyObject *__pyx_n_s_workset;
static PyObject *__pyx_n_s_workset_get;
static PyObject *__pyx_n_s_wrapped;
static PyObject *__pyx_n_s_wrapped_action;
static PyObject *__pyx_n_s_wraps;
static PyObject *__pyx_n_s_writer;
static PyObject *__pyx_n_s_writer_2;
static PyObject *__pyx_n_s_writer_queue_size;
static PyObject *__pyx_n_s_writer_threadpool;
static PyObject *__pyx_n_s_writer_threadpool_2;
static PyObject *__pyx_n_s_writer_threadpool_factory;
static PyObject *__pyx_n_s_writer_workers;
static PyObject *__pyx_n_s_wself;
static PyObject *__pyx_n_s_wself_2;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_pf_6chorde_7clients_5async_is_special(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callable_, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer_2undefer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer_4set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer_6done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_2_renew_undefer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_26AsyncCacheWriterThreadPool___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_workers, PyObject *__pyx_v_client, PyObject *__pyx_v_overflow, PyObject *__pyx_v_cleanup_cycles, PyObject *__pyx_v_defer_threadpool, PyObject *__pyx_v_writer_threadpool); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_2defer_threadpool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_4writer_threadpool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_6_writer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_reentrant); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_8capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_10usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_12dequeue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_14drop_one(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_16enqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_18clearqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_20_coalesce(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_22_enqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, CYTHON_UNUSED PyObject *__pyx_v_isinstance, PyObject *__pyx_v_getattr, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_24waitkey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_26getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_28contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_30_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_32put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_34renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_36delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_38expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_40clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_42purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_44register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_46register_default_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_writer_queue_size, PyObject *__pyx_v_writer_workers, PyObject *__pyx_v_overflow, PyObject *__pyx_v_threadpool, PyObject *__pyx_v_defer_threadpool, PyObject *__pyx_v_writer_threadpool); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_2assert_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_4is_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_6start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_8stop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_abort_tasks); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_10async(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_12capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_14usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_16put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_18renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_20delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_22expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_24clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_26purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_28getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_30get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_ttl_skip, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_32getTtlMulti(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_default, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, CYTHON_UNUSED PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_18__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_35getMulti(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_default, PyObject *__pyx_v_ttl_skip, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, CYTHON_UNUSED PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_38promote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_p, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_40wait(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_42contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_44register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_46__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_48__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_16ExceptionWrapper___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_16ExceptionWrapper_2reraise(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_logger); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_20__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_2_set_nothreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_hasattr, CYTHON_UNUSED PyObject *__pyx_v_tuple, CYTHON_UNUSED PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_4set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_hasattr, CYTHON_UNUSED PyObject *__pyx_v_tuple, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_6miss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_8_miss_nothreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_10exc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exc_info); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_12_exc_nothreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exc_info); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_14set_exception(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exception); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_8on_value_value_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_16on_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_7on_miss_miss_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_18on_miss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_6on_exc_exc_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_20on_exc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_6on_any_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_22on_any(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_value, PyObject *__pyx_v_on_miss, PyObject *__pyx_v_on_exc); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_24on_any_once(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_value, PyObject *__pyx_v_on_miss, PyObject *__pyx_v_on_exc); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_7on_done_done_callback(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_26on_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_28chain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_defer); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_30chain_std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_defer); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_24__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_32_on_stuff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_hasattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_17add_done_callback_weak_callback(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_34add_done_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_36done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_38running(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_40cancelled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_42cancel_pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_34__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_44cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_36__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_46set_running_or_notify_cancelled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_38__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_48result(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_timeout, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_getattr, PyObject *__pyx_v_isinstance, PyObject *__pyx_v_norecurse); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_50exception(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wrapped); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_f(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_2mkf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_4makeFutureWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_2reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_4on_task_queued(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_6on_task_cancelled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_8on_task_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wait_time); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_10on_task_completed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task_time); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers, PyObject *__pyx_v_client, PyObject *__pyx_v_coalescence_buffer_size, PyObject *__pyx_v_maxqueue, PyObject *__pyx_v_cleanup_cycles, PyObject *__pyx_v_threadpool); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_2threadpool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_2clean(PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_wrapped_action(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_4_enqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_action, PyObject *__pyx_v_coalesce, PyObject *__pyx_v_coalesce_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_6capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_10queuelen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_12do_async(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_14do_async_coalescent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_coalesce, PyObject *__pyx_v_coalesce_key, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_16bound(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_42__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_18getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_20get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_22contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_p, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_24put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_26renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_28add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_30delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_32expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_34clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_36purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_38register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_40register_default_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_processor, PyObject *__pyx_v_client, PyObject *__pyx_v_coalescence_buffer_size); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_2capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_4usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_6queuelen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_8maxqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_10stats(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_12do_async(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_14bound(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_16getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_18get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_20contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_p, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_22put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_24renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_26add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_28delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_30expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_32clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_34purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_36register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_38register_default_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task); /* proto */
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_1_getMulti(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_2_on_value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_3_on_miss(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_4_on_exc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_5_on_any(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_6_on_done(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_7_chain_std(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_9_mkf(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_10__enqueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_viewkeys = {0, &__pyx_n_s_viewkeys, 0, 0, 0};
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_0_05;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_500;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_slice__37;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_codeobj__9;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__248;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__311;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__327;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_codeobj__10;
static PyObject *__pyx_codeobj__13;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__23;
static PyObject *__pyx_codeobj__26;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__34;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__56;
static PyObject *__pyx_codeobj__58;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__84;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__92;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__121;
static PyObject *__pyx_codeobj__124;
static PyObject *__pyx_codeobj__126;
static PyObject *__pyx_codeobj__128;
static PyObject *__pyx_codeobj__130;
static PyObject *__pyx_codeobj__132;
static PyObject *__pyx_codeobj__134;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__143;
static PyObject *__pyx_codeobj__145;
static PyObject *__pyx_codeobj__149;
static PyObject *__pyx_codeobj__151;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__157;
static PyObject *__pyx_codeobj__159;
static PyObject *__pyx_codeobj__161;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__175;
static PyObject *__pyx_codeobj__177;
static PyObject *__pyx_codeobj__179;
static PyObject *__pyx_codeobj__181;
static PyObject *__pyx_codeobj__183;
static PyObject *__pyx_codeobj__185;
static PyObject *__pyx_codeobj__187;
static PyObject *__pyx_codeobj__189;
static PyObject *__pyx_codeobj__191;
static PyObject *__pyx_codeobj__193;
static PyObject *__pyx_codeobj__195;
static PyObject *__pyx_codeobj__198;
static PyObject *__pyx_codeobj__201;
static PyObject *__pyx_codeobj__203;
static PyObject *__pyx_codeobj__205;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__213;
static PyObject *__pyx_codeobj__215;
static PyObject *__pyx_codeobj__217;
static PyObject *__pyx_codeobj__219;
static PyObject *__pyx_codeobj__221;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__228;
static PyObject *__pyx_codeobj__230;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__247;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__264;
static PyObject *__pyx_codeobj__266;
static PyObject *__pyx_codeobj__268;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__280;
static PyObject *__pyx_codeobj__282;
static PyObject *__pyx_codeobj__284;
static PyObject *__pyx_codeobj__286;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__291;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__302;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__326;
static PyObject *__pyx_codeobj__328;
static PyObject *__pyx_codeobj__330;
/* Late includes */

/* "chorde/clients/async.py":33
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):             # <<<<<<<<<<<<<<
 *     return id(value) in SPECIAL
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_1is_special(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_1is_special = {"is_special", (PyCFunction)__pyx_pw_6chorde_7clients_5async_1is_special, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_1is_special(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_special (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_is_special(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_is_special(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_special", 0);

  /* "chorde/clients/async.py":34
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):
 *     return id(value) in SPECIAL             # <<<<<<<<<<<<<<
 * 
 * class Defer(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SPECIAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":33
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):             # <<<<<<<<<<<<<<
 *     return id(value) in SPECIAL
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.is_special", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":50
 *     """
 * 
 *     def __init__(self, callable_, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.callable_ = callable_
 *         self.args = args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_5Defer_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_5Defer_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callable_ = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callable,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callable)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); __PYX_ERR(0, 50, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 50, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_callable_ = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 50, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("chorde.clients.async.Defer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_5Defer___init__(__pyx_self, __pyx_v_self, __pyx_v_callable_, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callable_, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":51
 * 
 *     def __init__(self, callable_, *args, **kwargs):
 *         self.callable_ = callable_             # <<<<<<<<<<<<<<
 *         self.args = args
 *         self.kwargs = kwargs
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_callable, __pyx_v_callable_) < 0) __PYX_ERR(0, 51, __pyx_L1_error)

  /* "chorde/clients/async.py":52
 *     def __init__(self, callable_, *args, **kwargs):
 *         self.callable_ = callable_
 *         self.args = args             # <<<<<<<<<<<<<<
 *         self.kwargs = kwargs
 *         self.lazy = False
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_args, __pyx_v_args) < 0) __PYX_ERR(0, 52, __pyx_L1_error)

  /* "chorde/clients/async.py":53
 *         self.callable_ = callable_
 *         self.args = args
 *         self.kwargs = kwargs             # <<<<<<<<<<<<<<
 *         self.lazy = False
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_kwargs, __pyx_v_kwargs) < 0) __PYX_ERR(0, 53, __pyx_L1_error)

  /* "chorde/clients/async.py":54
 *         self.args = args
 *         self.kwargs = kwargs
 *         self.lazy = False             # <<<<<<<<<<<<<<
 * 
 *     def undefer(self, getattr=getattr):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lazy, Py_False) < 0) __PYX_ERR(0, 54, __pyx_L1_error)

  /* "chorde/clients/async.py":50
 *     """
 * 
 *     def __init__(self, callable_, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.callable_ = callable_
 *         self.args = args
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.Defer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":56
 *         self.lazy = False
 * 
 *     def undefer(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_3undefer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_5Defer_3undefer = {"undefer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_5Defer_3undefer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_3undefer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("undefer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "undefer") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("undefer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Defer.undefer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_5Defer_2undefer(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer_2undefer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_v_future = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("undefer", 0);

  /* "chorde/clients/async.py":57
 * 
 *     def undefer(self, getattr=getattr):
 *         future = getattr(self, 'future', None)             # <<<<<<<<<<<<<<
 *         if future is None or future.set_running_or_notify_cancelled():
 *             try:
 */
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_future, Py_None};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_future, Py_None};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_future);
    __Pyx_GIVEREF(__pyx_n_s_future);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_future);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_None);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_future = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":58
 *     def undefer(self, getattr=getattr):
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():             # <<<<<<<<<<<<<<
 *             try:
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 */
  __pyx_t_7 = (__pyx_v_future == Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set_running_or_notify_cancelled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":59
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 *             try:             # <<<<<<<<<<<<<<
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "chorde/clients/async.py":60
 *         if future is None or future.set_running_or_notify_cancelled():
 *             try:
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)             # <<<<<<<<<<<<<<
 *             except:
 *                 future = getattr(self, 'future', None)
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_callable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__pyx_t_3 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          __PYX_ERR(0, 60, __pyx_L6_error)
        }
        if (likely(PyDict_CheckExact(__pyx_t_3))) {
          __pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rv, __pyx_t_3) < 0) __PYX_ERR(0, 60, __pyx_L6_error)
        __Pyx_INCREF(__pyx_t_3);
        __pyx_v_rv = __pyx_t_3;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "chorde/clients/async.py":59
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 *             try:             # <<<<<<<<<<<<<<
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "chorde/clients/async.py":61
 *             try:
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 *             except:             # <<<<<<<<<<<<<<
 *                 future = getattr(self, 'future', None)
 *                 if future is not None:
 */
      /*except:*/ {
        __Pyx_AddTraceback("chorde.clients.async.Defer.undefer", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 61, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_5);

        /* "chorde/clients/async.py":62
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 *             except:
 *                 future = getattr(self, 'future', None)             # <<<<<<<<<<<<<<
 *                 if future is not None:
 *                     future.exc(sys.exc_info())
 */
        __Pyx_INCREF(__pyx_v_getattr);
        __pyx_t_12 = __pyx_v_getattr; __pyx_t_13 = NULL;
        __pyx_t_4 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_4 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_v_self, __pyx_n_s_future, Py_None};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L8_except_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
          PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_v_self, __pyx_n_s_future, Py_None};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L8_except_error)
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_INCREF(__pyx_v_self);
          __Pyx_GIVEREF(__pyx_v_self);
          PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_4, __pyx_v_self);
          __Pyx_INCREF(__pyx_n_s_future);
          __Pyx_GIVEREF(__pyx_n_s_future);
          PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_4, __pyx_n_s_future);
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_4, Py_None);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_future, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "chorde/clients/async.py":63
 *             except:
 *                 future = getattr(self, 'future', None)
 *                 if future is not None:             # <<<<<<<<<<<<<<
 *                     future.exc(sys.exc_info())
 *                 raise
 */
        __pyx_t_6 = (__pyx_v_future != Py_None);
        __pyx_t_8 = (__pyx_t_6 != 0);
        if (__pyx_t_8) {

          /* "chorde/clients/async.py":64
 *                 future = getattr(self, 'future', None)
 *                 if future is not None:
 *                     future.exc(sys.exc_info())             # <<<<<<<<<<<<<<
 *                 raise
 *             return rv
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_exc); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 64, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_sys); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 64, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 64, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_14 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 64, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_15 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          __pyx_t_1 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_14);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "chorde/clients/async.py":63
 *             except:
 *                 future = getattr(self, 'future', None)
 *                 if future is not None:             # <<<<<<<<<<<<<<
 *                     future.exc(sys.exc_info())
 *                 raise
 */
        }

        /* "chorde/clients/async.py":65
 *                 if future is not None:
 *                     future.exc(sys.exc_info())
 *                 raise             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_5);
        __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; 
        __PYX_ERR(0, 65, __pyx_L8_except_error)
      }
      __pyx_L8_except_error:;

      /* "chorde/clients/async.py":59
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 *             try:             # <<<<<<<<<<<<<<
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }

    /* "chorde/clients/async.py":66
 *                     future.exc(sys.exc_info())
 *                 raise
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             future = getattr(self, 'future', None)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_rv);
    __pyx_r = __pyx_v_rv;
    goto __pyx_L0;

    /* "chorde/clients/async.py":58
 *     def undefer(self, getattr=getattr):
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():             # <<<<<<<<<<<<<<
 *             try:
 *                 self.rv = rv = self.callable_(*self.args, **self.kwargs)
 */
  }

  /* "chorde/clients/async.py":68
 *             return rv
 *         else:
 *             future = getattr(self, 'future', None)             # <<<<<<<<<<<<<<
 *             if future is not None and not future.done():
 *                 future.set_exception(CancelledError())
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_getattr);
    __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_future, Py_None};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_future, Py_None};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_1 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_self);
      __Pyx_INCREF(__pyx_n_s_future);
      __Pyx_GIVEREF(__pyx_n_s_future);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_n_s_future);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_4, Py_None);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_future, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "chorde/clients/async.py":69
 *         else:
 *             future = getattr(self, 'future', None)
 *             if future is not None and not future.done():             # <<<<<<<<<<<<<<
 *                 future.set_exception(CancelledError())
 *             return _NONE
 */
    __pyx_t_6 = (__pyx_v_future != Py_None);
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_8 = __pyx_t_7;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 69, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = ((!__pyx_t_7) != 0);
    __pyx_t_8 = __pyx_t_6;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_8) {

      /* "chorde/clients/async.py":70
 *             future = getattr(self, 'future', None)
 *             if future is not None and not future.done():
 *                 future.set_exception(CancelledError())             # <<<<<<<<<<<<<<
 *             return _NONE
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "chorde/clients/async.py":69
 *         else:
 *             future = getattr(self, 'future', None)
 *             if future is not None and not future.done():             # <<<<<<<<<<<<<<
 *                 future.set_exception(CancelledError())
 *             return _NONE
 */
    }

    /* "chorde/clients/async.py":71
 *             if future is not None and not future.done():
 *                 future.set_exception(CancelledError())
 *             return _NONE             # <<<<<<<<<<<<<<
 * 
 *     def set(self, value):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":56
 *         self.lazy = False
 * 
 *     def undefer(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("chorde.clients.async.Defer.undefer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_future);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":73
 *             return _NONE
 * 
 *     def set(self, value):             # <<<<<<<<<<<<<<
 *         self.rv = value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_5set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_5Defer_5set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_5Defer_5set, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_5set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 73, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Defer.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_5Defer_4set(__pyx_self, __pyx_v_self, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer_4set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 0);

  /* "chorde/clients/async.py":74
 * 
 *     def set(self, value):
 *         self.rv = value             # <<<<<<<<<<<<<<
 * 
 *     def done(self, getattr=getattr):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rv, __pyx_v_value) < 0) __PYX_ERR(0, 74, __pyx_L1_error)

  /* "chorde/clients/async.py":73
 *             return _NONE
 * 
 *     def set(self, value):             # <<<<<<<<<<<<<<
 *         self.rv = value
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.Defer.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":76
 *         self.rv = value
 * 
 *     def done(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_7done(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_5Defer_7done = {"done", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_5Defer_7done, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_5Defer_7done(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "done") < 0)) __PYX_ERR(0, 76, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("done", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 76, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Defer.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_5Defer_6done(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_5Defer_6done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_v_future = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);

  /* "chorde/clients/async.py":77
 * 
 *     def done(self, getattr=getattr):
 *         future = getattr(self, 'future', None)             # <<<<<<<<<<<<<<
 *         if future is not None and not future.done():
 *             rv = getattr(self, 'rv', NONE)
 */
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_future, Py_None};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_future, Py_None};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_future);
    __Pyx_GIVEREF(__pyx_n_s_future);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_future);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_None);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_future = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":78
 *     def done(self, getattr=getattr):
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():             # <<<<<<<<<<<<<<
 *             rv = getattr(self, 'rv', NONE)
 *             if rv is _NONE or rv is NONE:
 */
  __pyx_t_7 = (__pyx_v_future != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = ((!__pyx_t_8) != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":79
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():
 *             rv = getattr(self, 'rv', NONE)             # <<<<<<<<<<<<<<
 *             if rv is _NONE or rv is NONE:
 *                 future.set_exception(CancelledError())
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_getattr);
    __pyx_t_5 = __pyx_v_getattr; __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_rv, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_rv, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_v_self);
      __Pyx_INCREF(__pyx_n_s_rv);
      __Pyx_GIVEREF(__pyx_n_s_rv);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_n_s_rv);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_4, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_rv = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":80
 *         if future is not None and not future.done():
 *             rv = getattr(self, 'rv', NONE)
 *             if rv is _NONE or rv is NONE:             # <<<<<<<<<<<<<<
 *                 future.set_exception(CancelledError())
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__pyx_v_rv == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_6 = __pyx_t_8;
      goto __pyx_L7_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (__pyx_v_rv == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = (__pyx_t_8 != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_6) {

      /* "chorde/clients/async.py":81
 *             rv = getattr(self, 'rv', NONE)
 *             if rv is _NONE or rv is NONE:
 *                 future.set_exception(CancelledError())             # <<<<<<<<<<<<<<
 *             else:
 *                 future.set(rv)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":80
 *         if future is not None and not future.done():
 *             rv = getattr(self, 'rv', NONE)
 *             if rv is _NONE or rv is NONE:             # <<<<<<<<<<<<<<
 *                 future.set_exception(CancelledError())
 *             else:
 */
      goto __pyx_L6;
    }

    /* "chorde/clients/async.py":83
 *                 future.set_exception(CancelledError())
 *             else:
 *                 future.set(rv)             # <<<<<<<<<<<<<<
 * 
 * def _renew_undefer(self, key, ttl, kw, value):
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_v_rv) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_rv);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "chorde/clients/async.py":78
 *     def done(self, getattr=getattr):
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():             # <<<<<<<<<<<<<<
 *             rv = getattr(self, 'rv', NONE)
 *             if rv is _NONE or rv is NONE:
 */
  }

  /* "chorde/clients/async.py":76
 *         self.rv = value
 * 
 *     def done(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.Defer.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_future);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":85
 *                 future.set(rv)
 * 
 * def _renew_undefer(self, key, ttl, kw, value):             # <<<<<<<<<<<<<<
 *     self = self()
 *     self.client.renew(key, ttl, **(kw or {}))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_3_renew_undefer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_3_renew_undefer = {"_renew_undefer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_3_renew_undefer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_3_renew_undefer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_renew_undefer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ttl,&__pyx_n_s_kw,&__pyx_n_s_value,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_renew_undefer", 1, 5, 5, 1); __PYX_ERR(0, 85, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_renew_undefer", 1, 5, 5, 2); __PYX_ERR(0, 85, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_renew_undefer", 1, 5, 5, 3); __PYX_ERR(0, 85, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_renew_undefer", 1, 5, 5, 4); __PYX_ERR(0, 85, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_renew_undefer") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_ttl = values[2];
    __pyx_v_kw = values[3];
    __pyx_v_value = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_renew_undefer", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async._renew_undefer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_2_renew_undefer(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ttl, __pyx_v_kw, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_2_renew_undefer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_renew_undefer", 0);
  __Pyx_INCREF(__pyx_v_self);

  /* "chorde/clients/async.py":86
 * 
 * def _renew_undefer(self, key, ttl, kw, value):
 *     self = self()             # <<<<<<<<<<<<<<
 *     self.client.renew(key, ttl, **(kw or {}))
 *     return value.undefer()
 */
  __Pyx_INCREF(__pyx_v_self);
  __pyx_t_2 = __pyx_v_self; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_self, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":87
 * def _renew_undefer(self, key, ttl, kw, value):
 *     self = self()
 *     self.client.renew(key, ttl, **(kw or {}))             # <<<<<<<<<<<<<<
 *     return value.undefer()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_renew); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ttl);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __Pyx_INCREF(__pyx_v_kw);
    __pyx_t_4 = __pyx_v_kw;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_4 = __pyx_t_6;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_L3_bool_binop_done:;
  if (unlikely(__pyx_t_4 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(0, 87, __pyx_L1_error)
  }
  if (likely(PyDict_CheckExact(__pyx_t_4))) {
    __pyx_t_3 = PyDict_Copy(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":88
 *     self = self()
 *     self.client.renew(key, ttl, **(kw or {}))
 *     return value.undefer()             # <<<<<<<<<<<<<<
 * 
 * _global_cleanup_tasks = []
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_undefer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":85
 *                 future.set(rv)
 * 
 * def _renew_undefer(self, key, ttl, kw, value):             # <<<<<<<<<<<<<<
 *     self = self()
 *     self.client.renew(key, ttl, **(kw or {}))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async._renew_undefer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":97
 *     Process = AsyncCacheWriterThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_26AsyncCacheWriterThreadPool_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_26AsyncCacheWriterThreadPool_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_26AsyncCacheWriterThreadPool_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_26AsyncCacheWriterThreadPool_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_workers = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_workers,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 97, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_workers = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterThreadPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_26AsyncCacheWriterThreadPool___init__(__pyx_self, __pyx_v_self, __pyx_v_workers);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_26AsyncCacheWriterThreadPool___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers) {
  PyObject *__pyx_v_current = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":98
 * 
 *     def __init__(self, workers):
 *         if ThreadPool is multiprocessing.pool.ThreadPool:             # <<<<<<<<<<<<<<
 *             # This patches ThreadPool, which is broken when instanced
 *             # from inside a DummyThread (happens after forking)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_1 == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":101
 *             # This patches ThreadPool, which is broken when instanced
 *             # from inside a DummyThread (happens after forking)
 *             current = multiprocessing.dummy.current_process()             # <<<<<<<<<<<<<<
 *             if not hasattr(current, '_children'):
 *                 current._children = weakref.WeakKeyDictionary()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_current_process); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_current = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "chorde/clients/async.py":102
 *             # from inside a DummyThread (happens after forking)
 *             current = multiprocessing.dummy.current_process()
 *             if not hasattr(current, '_children'):             # <<<<<<<<<<<<<<
 *                 current._children = weakref.WeakKeyDictionary()
 * 
 */
    __pyx_t_5 = __Pyx_HasAttr(__pyx_v_current, __pyx_n_s_children); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error)
    __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":103
 *             current = multiprocessing.dummy.current_process()
 *             if not hasattr(current, '_children'):
 *                 current._children = weakref.WeakKeyDictionary()             # <<<<<<<<<<<<<<
 * 
 *         ThreadPool.__init__(self, workers)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_weakref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_current, __pyx_n_s_children, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "chorde/clients/async.py":102
 *             # from inside a DummyThread (happens after forking)
 *             current = multiprocessing.dummy.current_process()
 *             if not hasattr(current, '_children'):             # <<<<<<<<<<<<<<
 *                 current._children = weakref.WeakKeyDictionary()
 * 
 */
    }

    /* "chorde/clients/async.py":98
 * 
 *     def __init__(self, workers):
 *         if ThreadPool is multiprocessing.pool.ThreadPool:             # <<<<<<<<<<<<<<
 *             # This patches ThreadPool, which is broken when instanced
 *             # from inside a DummyThread (happens after forking)
 */
  }

  /* "chorde/clients/async.py":105
 *                 current._children = weakref.WeakKeyDictionary()
 * 
 *         ThreadPool.__init__(self, workers)             # <<<<<<<<<<<<<<
 * 
 * class AsyncCacheWriterPool:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_workers};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_workers};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_workers);
    __Pyx_GIVEREF(__pyx_v_workers);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_workers);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":97
 *     Process = AsyncCacheWriterThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterThreadPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":108
 * 
 * class AsyncCacheWriterPool:
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_workers = 0;
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_overflow = 0;
  PyObject *__pyx_v_cleanup_cycles = 0;
  PyObject *__pyx_v_defer_threadpool = 0;
  PyObject *__pyx_v_writer_threadpool = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_size,&__pyx_n_s_workers,&__pyx_n_s_client,&__pyx_n_s_overflow,&__pyx_n_s_cleanup_cycles,&__pyx_n_s_defer_threadpool,&__pyx_n_s_writer_threadpool,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_500));

    /* "chorde/clients/async.py":109
 * class AsyncCacheWriterPool:
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,
 *             defer_threadpool = None, writer_threadpool = None):             # <<<<<<<<<<<<<<
 * 
 *         self.client = client
 */
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, 1); __PYX_ERR(0, 108, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, 2); __PYX_ERR(0, 108, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, 3); __PYX_ERR(0, 108, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overflow);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cleanup_cycles);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defer_threadpool);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_threadpool);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_size = values[1];
    __pyx_v_workers = values[2];
    __pyx_v_client = values[3];
    __pyx_v_overflow = values[4];
    __pyx_v_cleanup_cycles = values[5];
    __pyx_v_defer_threadpool = values[6];
    __pyx_v_writer_threadpool = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool___init__(__pyx_self, __pyx_v_self, __pyx_v_size, __pyx_v_workers, __pyx_v_client, __pyx_v_overflow, __pyx_v_cleanup_cycles, __pyx_v_defer_threadpool, __pyx_v_writer_threadpool);

  /* "chorde/clients/async.py":108
 * 
 * class AsyncCacheWriterPool:
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_workers, PyObject *__pyx_v_client, PyObject *__pyx_v_overflow, PyObject *__pyx_v_cleanup_cycles, PyObject *__pyx_v_defer_threadpool, PyObject *__pyx_v_writer_threadpool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":111
 *             defer_threadpool = None, writer_threadpool = None):
 * 
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.logger = logging.getLogger("chorde.async")
 *         self.size = size
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 111, __pyx_L1_error)

  /* "chorde/clients/async.py":112
 * 
 *         self.client = client
 *         self.logger = logging.getLogger("chorde.async")             # <<<<<<<<<<<<<<
 *         self.size = size
 *         self.workers = workers
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_chorde_async) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_chorde_async);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":113
 *         self.client = client
 *         self.logger = logging.getLogger("chorde.async")
 *         self.size = size             # <<<<<<<<<<<<<<
 *         self.workers = workers
 *         self._spawnlock = threading.Lock()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 113, __pyx_L1_error)

  /* "chorde/clients/async.py":114
 *         self.logger = logging.getLogger("chorde.async")
 *         self.size = size
 *         self.workers = workers             # <<<<<<<<<<<<<<
 *         self._spawnlock = threading.Lock()
 *         if callable(defer_threadpool):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_workers, __pyx_v_workers) < 0) __PYX_ERR(0, 114, __pyx_L1_error)

  /* "chorde/clients/async.py":115
 *         self.size = size
 *         self.workers = workers
 *         self._spawnlock = threading.Lock()             # <<<<<<<<<<<<<<
 *         if callable(defer_threadpool):
 *             self._defer_threadpool_factory = defer_threadpool
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spawnlock, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":116
 *         self.workers = workers
 *         self._spawnlock = threading.Lock()
 *         if callable(defer_threadpool):             # <<<<<<<<<<<<<<
 *             self._defer_threadpool_factory = defer_threadpool
 *             self._defer_threadpool = None
 */
  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_defer_threadpool); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":117
 *         self._spawnlock = threading.Lock()
 *         if callable(defer_threadpool):
 *             self._defer_threadpool_factory = defer_threadpool             # <<<<<<<<<<<<<<
 *             self._defer_threadpool = None
 *         else:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_factory, __pyx_v_defer_threadpool) < 0) __PYX_ERR(0, 117, __pyx_L1_error)

    /* "chorde/clients/async.py":118
 *         if callable(defer_threadpool):
 *             self._defer_threadpool_factory = defer_threadpool
 *             self._defer_threadpool = None             # <<<<<<<<<<<<<<
 *         else:
 *             self._defer_threadpool_factory = None
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2, Py_None) < 0) __PYX_ERR(0, 118, __pyx_L1_error)

    /* "chorde/clients/async.py":116
 *         self.workers = workers
 *         self._spawnlock = threading.Lock()
 *         if callable(defer_threadpool):             # <<<<<<<<<<<<<<
 *             self._defer_threadpool_factory = defer_threadpool
 *             self._defer_threadpool = None
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":120
 *             self._defer_threadpool = None
 *         else:
 *             self._defer_threadpool_factory = None             # <<<<<<<<<<<<<<
 *             self._defer_threadpool = defer_threadpool
 *         if callable(writer_threadpool):
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_factory, Py_None) < 0) __PYX_ERR(0, 120, __pyx_L1_error)

    /* "chorde/clients/async.py":121
 *         else:
 *             self._defer_threadpool_factory = None
 *             self._defer_threadpool = defer_threadpool             # <<<<<<<<<<<<<<
 *         if callable(writer_threadpool):
 *             self._writer_threadpool_factory = writer_threadpool
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2, __pyx_v_defer_threadpool) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":122
 *             self._defer_threadpool_factory = None
 *             self._defer_threadpool = defer_threadpool
 *         if callable(writer_threadpool):             # <<<<<<<<<<<<<<
 *             self._writer_threadpool_factory = writer_threadpool
 *             self._writer_threadpool = None
 */
  __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_writer_threadpool); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 122, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "chorde/clients/async.py":123
 *             self._defer_threadpool = defer_threadpool
 *         if callable(writer_threadpool):
 *             self._writer_threadpool_factory = writer_threadpool             # <<<<<<<<<<<<<<
 *             self._writer_threadpool = None
 *         else:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_factory, __pyx_v_writer_threadpool) < 0) __PYX_ERR(0, 123, __pyx_L1_error)

    /* "chorde/clients/async.py":124
 *         if callable(writer_threadpool):
 *             self._writer_threadpool_factory = writer_threadpool
 *             self._writer_threadpool = None             # <<<<<<<<<<<<<<
 *         else:
 *             self._writer_threadpool_factory = None
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2, Py_None) < 0) __PYX_ERR(0, 124, __pyx_L1_error)

    /* "chorde/clients/async.py":122
 *             self._defer_threadpool_factory = None
 *             self._defer_threadpool = defer_threadpool
 *         if callable(writer_threadpool):             # <<<<<<<<<<<<<<
 *             self._writer_threadpool_factory = writer_threadpool
 *             self._writer_threadpool = None
 */
    goto __pyx_L4;
  }

  /* "chorde/clients/async.py":126
 *             self._writer_threadpool = None
 *         else:
 *             self._writer_threadpool_factory = None             # <<<<<<<<<<<<<<
 *             self._writer_threadpool = writer_threadpool
 * 
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_factory, Py_None) < 0) __PYX_ERR(0, 126, __pyx_L1_error)

    /* "chorde/clients/async.py":127
 *         else:
 *             self._writer_threadpool_factory = None
 *             self._writer_threadpool = writer_threadpool             # <<<<<<<<<<<<<<
 * 
 *         # queueset holds the values to be written, associated
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2, __pyx_v_writer_threadpool) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "chorde/clients/async.py":132
 *         # by key, providing some write-back coalescense in
 *         # high-load environments
 *         self.queueset = {}             # <<<<<<<<<<<<<<
 *         self.workset = {}
 *         self.threadset = set()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_queueset, __pyx_t_1) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":133
 *         # high-load environments
 *         self.queueset = {}
 *         self.workset = {}             # <<<<<<<<<<<<<<
 *         self.threadset = set()
 *         self.done_event = threading.Event()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_workset, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":134
 *         self.queueset = {}
 *         self.workset = {}
 *         self.threadset = set()             # <<<<<<<<<<<<<<
 *         self.done_event = threading.Event()
 *         self.overflow = overflow
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadset, __pyx_t_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":135
 *         self.workset = {}
 *         self.threadset = set()
 *         self.done_event = threading.Event()             # <<<<<<<<<<<<<<
 *         self.overflow = overflow
 *         self._wself = weakref.ref(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Event); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_done_event, __pyx_t_1) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":136
 *         self.threadset = set()
 *         self.done_event = threading.Event()
 *         self.overflow = overflow             # <<<<<<<<<<<<<<
 *         self._wself = weakref.ref(self)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_overflow, __pyx_v_overflow) < 0) __PYX_ERR(0, 136, __pyx_L1_error)

  /* "chorde/clients/async.py":137
 *         self.done_event = threading.Event()
 *         self.overflow = overflow
 *         self._wself = weakref.ref(self)             # <<<<<<<<<<<<<<
 * 
 *         self.tl = threading.local()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_weakref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wself, __pyx_t_1) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":139
 *         self._wself = weakref.ref(self)
 * 
 *         self.tl = threading.local()             # <<<<<<<<<<<<<<
 *         self.cleanup_tasks = []
 *         self.cleanup_cycles = cleanup_cycles
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_local); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tl, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":140
 * 
 *         self.tl = threading.local()
 *         self.cleanup_tasks = []             # <<<<<<<<<<<<<<
 *         self.cleanup_cycles = cleanup_cycles
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_tasks, __pyx_t_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":141
 *         self.tl = threading.local()
 *         self.cleanup_tasks = []
 *         self.cleanup_cycles = cleanup_cycles             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_cycles, __pyx_v_cleanup_cycles) < 0) __PYX_ERR(0, 141, __pyx_L1_error)

  /* "chorde/clients/async.py":108
 * 
 * class AsyncCacheWriterPool:
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":144
 * 
 *     @property
 *     def defer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_3defer_threadpool(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_3defer_threadpool = {"defer_threadpool", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_3defer_threadpool, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_3defer_threadpool(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("defer_threadpool (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_2defer_threadpool(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_2defer_threadpool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("defer_threadpool", 0);

  /* "chorde/clients/async.py":145
 *     @property
 *     def defer_threadpool(self):
 *         if self._defer_threadpool is None:             # <<<<<<<<<<<<<<
 *             with self._spawnlock:
 *                 if self._defer_threadpool is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":146
 *     def defer_threadpool(self):
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._defer_threadpool is None:
 *                     if self._defer_threadpool_factory is not None:
 */
    /*with:*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spawnlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {

            /* "chorde/clients/async.py":147
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:
 *                 if self._defer_threadpool is None:             # <<<<<<<<<<<<<<
 *                     if self._defer_threadpool_factory is not None:
 *                         self._defer_threadpool = self._defer_threadpool_factory(self.workers)
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = (__pyx_t_1 == Py_None);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {

              /* "chorde/clients/async.py":148
 *             with self._spawnlock:
 *                 if self._defer_threadpool is None:
 *                     if self._defer_threadpool_factory is not None:             # <<<<<<<<<<<<<<
 *                         self._defer_threadpool = self._defer_threadpool_factory(self.workers)
 *                     else:
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_factory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = (__pyx_t_1 != Py_None);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_3 = (__pyx_t_2 != 0);
              if (__pyx_t_3) {

                /* "chorde/clients/async.py":149
 *                 if self._defer_threadpool is None:
 *                     if self._defer_threadpool_factory is not None:
 *                         self._defer_threadpool = self._defer_threadpool_factory(self.workers)             # <<<<<<<<<<<<<<
 *                     else:
 *                         self._defer_threadpool = AsyncCacheWriterThreadPool(self.workers)
 */
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_factory); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_5, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 149, __pyx_L8_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                /* "chorde/clients/async.py":148
 *             with self._spawnlock:
 *                 if self._defer_threadpool is None:
 *                     if self._defer_threadpool_factory is not None:             # <<<<<<<<<<<<<<
 *                         self._defer_threadpool = self._defer_threadpool_factory(self.workers)
 *                     else:
 */
                goto __pyx_L15;
              }

              /* "chorde/clients/async.py":151
 *                         self._defer_threadpool = self._defer_threadpool_factory(self.workers)
 *                     else:
 *                         self._defer_threadpool = AsyncCacheWriterThreadPool(self.workers)             # <<<<<<<<<<<<<<
 *         return self._defer_threadpool
 * 
 */
              /*else*/ {
                __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AsyncCacheWriterThreadPool); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_5, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 151, __pyx_L8_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __pyx_L15:;

              /* "chorde/clients/async.py":147
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:
 *                 if self._defer_threadpool is None:             # <<<<<<<<<<<<<<
 *                     if self._defer_threadpool_factory is not None:
 *                         self._defer_threadpool = self._defer_threadpool_factory(self.workers)
 */
            }

            /* "chorde/clients/async.py":146
 *     def defer_threadpool(self):
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._defer_threadpool is None:
 *                     if self._defer_threadpool_factory is not None:
 */
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.defer_threadpool", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 146, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_3 < 0) __PYX_ERR(0, 146, __pyx_L10_except_error)
            __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
            if (__pyx_t_2) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_5, __pyx_t_6);
              __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; 
              __PYX_ERR(0, 146, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "chorde/clients/async.py":145
 *     @property
 *     def defer_threadpool(self):
 *         if self._defer_threadpool is None:             # <<<<<<<<<<<<<<
 *             with self._spawnlock:
 *                 if self._defer_threadpool is None:
 */
  }

  /* "chorde/clients/async.py":152
 *                     else:
 *                         self._defer_threadpool = AsyncCacheWriterThreadPool(self.workers)
 *         return self._defer_threadpool             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":144
 * 
 *     @property
 *     def defer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.defer_threadpool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":155
 * 
 *     @property
 *     def writer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_5writer_threadpool(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_5writer_threadpool = {"writer_threadpool", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_5writer_threadpool, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_5writer_threadpool(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writer_threadpool (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_4writer_threadpool(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_4writer_threadpool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("writer_threadpool", 0);

  /* "chorde/clients/async.py":156
 *     @property
 *     def writer_threadpool(self):
 *         if self._writer_threadpool is None:             # <<<<<<<<<<<<<<
 *             with self._spawnlock:
 *                 if self._writer_threadpool is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":157
 *     def writer_threadpool(self):
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._writer_threadpool is None:
 *                     if self._writer_threadpool_factory is not None:
 */
    /*with:*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spawnlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {

            /* "chorde/clients/async.py":158
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:
 *                 if self._writer_threadpool is None:             # <<<<<<<<<<<<<<
 *                     if self._writer_threadpool_factory is not None:
 *                         self._writer_threadpool = self._writer_threadpool_factory(self.workers)
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = (__pyx_t_1 == Py_None);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {

              /* "chorde/clients/async.py":159
 *             with self._spawnlock:
 *                 if self._writer_threadpool is None:
 *                     if self._writer_threadpool_factory is not None:             # <<<<<<<<<<<<<<
 *                         self._writer_threadpool = self._writer_threadpool_factory(self.workers)
 *                     else:
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_factory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = (__pyx_t_1 != Py_None);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_3 = (__pyx_t_2 != 0);
              if (__pyx_t_3) {

                /* "chorde/clients/async.py":160
 *                 if self._writer_threadpool is None:
 *                     if self._writer_threadpool_factory is not None:
 *                         self._writer_threadpool = self._writer_threadpool_factory(self.workers)             # <<<<<<<<<<<<<<
 *                     else:
 *                         self._writer_threadpool = AsyncCacheWriterThreadPool(self.workers)
 */
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_factory); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_5, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L8_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                /* "chorde/clients/async.py":159
 *             with self._spawnlock:
 *                 if self._writer_threadpool is None:
 *                     if self._writer_threadpool_factory is not None:             # <<<<<<<<<<<<<<
 *                         self._writer_threadpool = self._writer_threadpool_factory(self.workers)
 *                     else:
 */
                goto __pyx_L15;
              }

              /* "chorde/clients/async.py":162
 *                         self._writer_threadpool = self._writer_threadpool_factory(self.workers)
 *                     else:
 *                         self._writer_threadpool = AsyncCacheWriterThreadPool(self.workers)             # <<<<<<<<<<<<<<
 *         return self._writer_threadpool
 * 
 */
              /*else*/ {
                __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AsyncCacheWriterThreadPool); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_5, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 162, __pyx_L8_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __pyx_L15:;

              /* "chorde/clients/async.py":158
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:
 *                 if self._writer_threadpool is None:             # <<<<<<<<<<<<<<
 *                     if self._writer_threadpool_factory is not None:
 *                         self._writer_threadpool = self._writer_threadpool_factory(self.workers)
 */
            }

            /* "chorde/clients/async.py":157
 *     def writer_threadpool(self):
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._writer_threadpool is None:
 *                     if self._writer_threadpool_factory is not None:
 */
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.writer_threadpool", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 157, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 157, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_3 < 0) __PYX_ERR(0, 157, __pyx_L10_except_error)
            __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
            if (__pyx_t_2) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_5, __pyx_t_6);
              __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; 
              __PYX_ERR(0, 157, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "chorde/clients/async.py":156
 *     @property
 *     def writer_threadpool(self):
 *         if self._writer_threadpool is None:             # <<<<<<<<<<<<<<
 *             with self._spawnlock:
 *                 if self._writer_threadpool is None:
 */
  }

  /* "chorde/clients/async.py":163
 *                     else:
 *                         self._writer_threadpool = AsyncCacheWriterThreadPool(self.workers)
 *         return self._writer_threadpool             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":155
 * 
 *     @property
 *     def writer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.writer_threadpool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":166
 * 
 *     @staticmethod
 *     def _writer(self, key, reentrant = True):             # <<<<<<<<<<<<<<
 *         # self is weakref
 *         self = self()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_7_writer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_7_writer = {"_writer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_7_writer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_7_writer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_reentrant = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_writer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_reentrant,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_writer", 0, 2, 3, 1); __PYX_ERR(0, 166, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reentrant);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_writer") < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_reentrant = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_writer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 166, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_6_writer(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_reentrant);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_6_writer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_reentrant) {
  PyObject *__pyx_v_thread_id = NULL;
  PyObject *__pyx_v_ev = NULL;
  PyObject *__pyx_v_deferred = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_ttl = NULL;
  PyObject *__pyx_v_kw = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_kev = NULL;
  PyObject *__pyx_v_task = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  Py_ssize_t __pyx_t_25;
  PyObject *(*__pyx_t_26)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_writer", 0);
  __Pyx_INCREF(__pyx_v_self);

  /* "chorde/clients/async.py":168
 *     def _writer(self, key, reentrant = True):
 *         # self is weakref
 *         self = self()             # <<<<<<<<<<<<<<
 *         if self is None:
 *             return
 */
  __Pyx_INCREF(__pyx_v_self);
  __pyx_t_2 = __pyx_v_self; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_self, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":169
 *         # self is weakref
 *         self = self()
 *         if self is None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_4 = (__pyx_v_self == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":170
 *         self = self()
 *         if self is None:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if reentrant:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "chorde/clients/async.py":169
 *         # self is weakref
 *         self = self()
 *         if self is None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "chorde/clients/async.py":172
 *             return
 * 
 *         if reentrant:             # <<<<<<<<<<<<<<
 *             thread_id = thread.get_ident()
 *             if thread_id not in self.threadset:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_reentrant); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":173
 * 
 *         if reentrant:
 *             thread_id = thread.get_ident()             # <<<<<<<<<<<<<<
 *             if thread_id not in self.threadset:
 *                 self.threadset.add(thread_id)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_ident); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_thread_id = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":174
 *         if reentrant:
 *             thread_id = thread.get_ident()
 *             if thread_id not in self.threadset:             # <<<<<<<<<<<<<<
 *                 self.threadset.add(thread_id)
 *             else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_thread_id, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":175
 *             thread_id = thread.get_ident()
 *             if thread_id not in self.threadset:
 *                 self.threadset.add(thread_id)             # <<<<<<<<<<<<<<
 *             else:
 *                 thread_id = None
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_thread_id) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_thread_id);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":174
 *         if reentrant:
 *             thread_id = thread.get_ident()
 *             if thread_id not in self.threadset:             # <<<<<<<<<<<<<<
 *                 self.threadset.add(thread_id)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "chorde/clients/async.py":177
 *                 self.threadset.add(thread_id)
 *             else:
 *                 thread_id = None             # <<<<<<<<<<<<<<
 *         else:
 *             thread_id = None
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_thread_id, Py_None);
    }
    __pyx_L5:;

    /* "chorde/clients/async.py":172
 *             return
 * 
 *         if reentrant:             # <<<<<<<<<<<<<<
 *             thread_id = thread.get_ident()
 *             if thread_id not in self.threadset:
 */
    goto __pyx_L4;
  }

  /* "chorde/clients/async.py":179
 *                 thread_id = None
 *         else:
 *             thread_id = None             # <<<<<<<<<<<<<<
 * 
 *         ev = self.done_event
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_thread_id = Py_None;
  }
  __pyx_L4:;

  /* "chorde/clients/async.py":181
 *             thread_id = None
 * 
 *         ev = self.done_event             # <<<<<<<<<<<<<<
 *         deferred = _NONE
 *         value = self.dequeue(key)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_done_event); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ev = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":182
 * 
 *         ev = self.done_event
 *         deferred = _NONE             # <<<<<<<<<<<<<<
 *         value = self.dequeue(key)
 *         try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_deferred = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":183
 *         ev = self.done_event
 *         deferred = _NONE
 *         value = self.dequeue(key)             # <<<<<<<<<<<<<<
 *         try:
 *             if value is _NONE or value is NONE:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dequeue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":184
 *         deferred = _NONE
 *         value = self.dequeue(key)
 *         try:             # <<<<<<<<<<<<<<
 *             if value is _NONE or value is NONE:
 *                 # Cancelled
 */
  /*try:*/ {

    /* "chorde/clients/async.py":185
 *         value = self.dequeue(key)
 *         try:
 *             if value is _NONE or value is NONE:             # <<<<<<<<<<<<<<
 *                 # Cancelled
 *                 return
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__pyx_v_value == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_4 = __pyx_t_6;
      goto __pyx_L10_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__pyx_v_value == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    __pyx_t_4 = __pyx_t_5;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":187
 *             if value is _NONE or value is NONE:
 *                 # Cancelled
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 # Unpack
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L6_return;

      /* "chorde/clients/async.py":185
 *         value = self.dequeue(key)
 *         try:
 *             if value is _NONE or value is NONE:             # <<<<<<<<<<<<<<
 *                 # Cancelled
 *                 return
 */
    }

    /* "chorde/clients/async.py":190
 *             else:
 *                 # Unpack
 *                 value, ttl, kw = value             # <<<<<<<<<<<<<<
 * 
 *             if value is _NONE or value is NONE:
 */
    /*else*/ {
      if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) {
        PyObject* sequence = __pyx_v_value;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 190, __pyx_L7_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 2; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 190, __pyx_L7_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 190, __pyx_L7_error)
        __pyx_L13_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_v_ttl = __pyx_t_2;
      __pyx_t_2 = 0;
      __pyx_v_kw = __pyx_t_3;
      __pyx_t_3 = 0;
    }

    /* "chorde/clients/async.py":192
 *                 value, ttl, kw = value
 * 
 *             if value is _NONE or value is NONE:             # <<<<<<<<<<<<<<
 *                 # Something's hinky
 *                 return
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = (__pyx_v_value == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_4 = __pyx_t_6;
      goto __pyx_L15_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = (__pyx_v_value == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    __pyx_t_4 = __pyx_t_5;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":194
 *             if value is _NONE or value is NONE:
 *                 # Something's hinky
 *                 return             # <<<<<<<<<<<<<<
 *             elif hasattr(value, 'undefer'):
 *                 deferred = value
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L6_return;

      /* "chorde/clients/async.py":192
 *                 value, ttl, kw = value
 * 
 *             if value is _NONE or value is NONE:             # <<<<<<<<<<<<<<
 *                 # Something's hinky
 *                 return
 */
    }

    /* "chorde/clients/async.py":195
 *                 # Something's hinky
 *                 return
 *             elif hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                 deferred = value
 *                 try:
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_value, __pyx_n_s_undefer); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L7_error)
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":196
 *                 return
 *             elif hasattr(value, 'undefer'):
 *                 deferred = value             # <<<<<<<<<<<<<<
 *                 try:
 *                     value = value.undefer()
 */
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_DECREF_SET(__pyx_v_deferred, __pyx_v_value);

      /* "chorde/clients/async.py":197
 *             elif hasattr(value, 'undefer'):
 *                 deferred = value
 *                 try:             # <<<<<<<<<<<<<<
 *                     value = value.undefer()
 *                     if value is REGET:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "chorde/clients/async.py":198
 *                 deferred = value
 *                 try:
 *                     value = value.undefer()             # <<<<<<<<<<<<<<
 *                     if value is REGET:
 *                         deferred.set(self.client.get(key))
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_undefer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "chorde/clients/async.py":199
 *                 try:
 *                     value = value.undefer()
 *                     if value is REGET:             # <<<<<<<<<<<<<<
 *                         deferred.set(self.client.get(key))
 *                         value = _NONE # don't set, it's already set
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_REGET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = (__pyx_v_value == __pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_4 = (__pyx_t_5 != 0);
          if (__pyx_t_4) {

            /* "chorde/clients/async.py":200
 *                     value = value.undefer()
 *                     if value is REGET:
 *                         deferred.set(self.client.get(key))             # <<<<<<<<<<<<<<
 *                         value = _NONE # don't set, it's already set
 *                 except CacheMissError:
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_deferred, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_12, function);
              }
            }
            __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_key);
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            __pyx_t_3 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "chorde/clients/async.py":201
 *                     if value is REGET:
 *                         deferred.set(self.client.get(key))
 *                         value = _NONE # don't set, it's already set             # <<<<<<<<<<<<<<
 *                 except CacheMissError:
 *                     # It's ok, accepted pattern to cancel computation in a transparent way
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "chorde/clients/async.py":199
 *                 try:
 *                     value = value.undefer()
 *                     if value is REGET:             # <<<<<<<<<<<<<<
 *                         deferred.set(self.client.get(key))
 *                         value = _NONE # don't set, it's already set
 */
          }

          /* "chorde/clients/async.py":197
 *             elif hasattr(value, 'undefer'):
 *                 deferred = value
 *                 try:             # <<<<<<<<<<<<<<
 *                     value = value.undefer()
 *                     if value is REGET:
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L22_try_end;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":202
 *                         deferred.set(self.client.get(key))
 *                         value = _NONE # don't set, it's already set
 *                 except CacheMissError:             # <<<<<<<<<<<<<<
 *                     # It's ok, accepted pattern to cancel computation in a transparent way
 *                     value = _NONE
 */
        __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L19_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
        __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0;
        if (__pyx_t_13) {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 202, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);

          /* "chorde/clients/async.py":204
 *                 except CacheMissError:
 *                     # It's ok, accepted pattern to cancel computation in a transparent way
 *                     value = _NONE             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error in background cache refresh", exc_info=True)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_NONE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 204, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_12);
          __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L18_exception_handled;
        }

        /* "chorde/clients/async.py":205
 *                     # It's ok, accepted pattern to cancel computation in a transparent way
 *                     value = _NONE
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error in background cache refresh", exc_info=True)
 *                     value = _NONE
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 205, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);

          /* "chorde/clients/async.py":206
 *                     value = _NONE
 *                 except:
 *                     self.logger.error("Error in background cache refresh", exc_info=True)             # <<<<<<<<<<<<<<
 *                     value = _NONE
 * 
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 206, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L19_except_error)
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__2, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 206, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "chorde/clients/async.py":207
 *                 except:
 *                     self.logger.error("Error in background cache refresh", exc_info=True)
 *                     value = _NONE             # <<<<<<<<<<<<<<
 * 
 *             if value is _NONE or value is NONE:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 207, __pyx_L19_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_14);
          __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L18_exception_handled;
        }
        __pyx_L19_except_error:;

        /* "chorde/clients/async.py":197
 *             elif hasattr(value, 'undefer'):
 *                 deferred = value
 *                 try:             # <<<<<<<<<<<<<<
 *                     value = value.undefer()
 *                     if value is REGET:
 */
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L7_error;
        __pyx_L18_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L22_try_end:;
      }

      /* "chorde/clients/async.py":195
 *                 # Something's hinky
 *                 return
 *             elif hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                 deferred = value
 *                 try:
 */
    }

    /* "chorde/clients/async.py":209
 *                     value = _NONE
 * 
 *             if value is _NONE or value is NONE:             # <<<<<<<<<<<<<<
 *                 # undefer probably decided not to compute anything (or an error arose, whatever)
 *                 if deferred is not _NONE:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__pyx_v_value == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_4 = __pyx_t_6;
      goto __pyx_L29_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__pyx_v_value == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    __pyx_t_4 = __pyx_t_5;
    __pyx_L29_bool_binop_done:;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":211
 *             if value is _NONE or value is NONE:
 *                 # undefer probably decided not to compute anything (or an error arose, whatever)
 *                 if deferred is not _NONE:             # <<<<<<<<<<<<<<
 *                     deferred.done()
 *                 return
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = (__pyx_v_deferred != __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = (__pyx_t_4 != 0);
      if (__pyx_t_5) {

        /* "chorde/clients/async.py":212
 *                 # undefer probably decided not to compute anything (or an error arose, whatever)
 *                 if deferred is not _NONE:
 *                     deferred.done()             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_deferred, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "chorde/clients/async.py":211
 *             if value is _NONE or value is NONE:
 *                 # undefer probably decided not to compute anything (or an error arose, whatever)
 *                 if deferred is not _NONE:             # <<<<<<<<<<<<<<
 *                     deferred.done()
 *                 return
 */
      }

      /* "chorde/clients/async.py":213
 *                 if deferred is not _NONE:
 *                     deferred.done()
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             elif value is _DELETE:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L6_return;

      /* "chorde/clients/async.py":209
 *                     value = _NONE
 * 
 *             if value is _NONE or value is NONE:             # <<<<<<<<<<<<<<
 *                 # undefer probably decided not to compute anything (or an error arose, whatever)
 *                 if deferred is not _NONE:
 */
    }

    /* "chorde/clients/async.py":215
 *                 return
 * 
 *             elif value is _DELETE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.delete(key)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__pyx_v_value == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":216
 * 
 *             elif value is _DELETE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.delete(key)
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "chorde/clients/async.py":217
 *             elif value is _DELETE:
 *                 try:
 *                     self.client.delete(key)             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error deleting key", exc_info=True)
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L32_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_delete); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L32_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L32_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "chorde/clients/async.py":216
 * 
 *             elif value is _DELETE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.delete(key)
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L37_try_end;
        __pyx_L32_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":218
 *                 try:
 *                     self.client.delete(key)
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error deleting key", exc_info=True)
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 218, __pyx_L34_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);

          /* "chorde/clients/async.py":219
 *                     self.client.delete(key)
 *                 except:
 *                     self.logger.error("Error deleting key", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _RENEW:
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 219, __pyx_L34_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 219, __pyx_L34_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 219, __pyx_L34_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 219, __pyx_L34_except_error)
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__3, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L34_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L33_exception_handled;
        }
        __pyx_L34_except_error:;

        /* "chorde/clients/async.py":216
 * 
 *             elif value is _DELETE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.delete(key)
 *                 except:
 */
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        goto __pyx_L7_error;
        __pyx_L33_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        __pyx_L37_try_end:;
      }

      /* "chorde/clients/async.py":215
 *                 return
 * 
 *             elif value is _DELETE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.delete(key)
 */
      goto __pyx_L28;
    }

    /* "chorde/clients/async.py":221
 *                     self.logger.error("Error deleting key", exc_info=True)
 * 
 *             elif value is _RENEW:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.renew(key, ttl, **(kw or {}))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_value == __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":222
 * 
 *             elif value is _RENEW:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.renew(key, ttl, **(kw or {}))
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "chorde/clients/async.py":223
 *             elif value is _RENEW:
 *                 try:
 *                     self.client.renew(key, ttl, **(kw or {}))             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error renewing key", exc_info=True)
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L40_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_renew); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L40_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L40_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
          __Pyx_INCREF(__pyx_v_ttl);
          __Pyx_GIVEREF(__pyx_v_ttl);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ttl);
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 223, __pyx_L40_error)
          if (!__pyx_t_5) {
          } else {
            __Pyx_INCREF(__pyx_v_kw);
            __pyx_t_7 = __pyx_v_kw;
            goto __pyx_L46_bool_binop_done;
          }
          __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 223, __pyx_L40_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_14);
          __pyx_t_7 = __pyx_t_14;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_L46_bool_binop_done:;
          if (unlikely(__pyx_t_7 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
            __PYX_ERR(0, 223, __pyx_L40_error)
          }
          if (likely(PyDict_CheckExact(__pyx_t_7))) {
            __pyx_t_1 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L40_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else {
            __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L40_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 223, __pyx_L40_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":222
 * 
 *             elif value is _RENEW:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.renew(key, ttl, **(kw or {}))
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L45_try_end;
        __pyx_L40_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":224
 *                 try:
 *                     self.client.renew(key, ttl, **(kw or {}))
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error renewing key", exc_info=True)
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 224, __pyx_L42_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);

          /* "chorde/clients/async.py":225
 *                     self.client.renew(key, ttl, **(kw or {}))
 *                 except:
 *                     self.logger.error("Error renewing key", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _EXPIRE:
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L42_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 225, __pyx_L42_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L42_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 225, __pyx_L42_except_error)
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__4, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 225, __pyx_L42_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L41_exception_handled;
        }
        __pyx_L42_except_error:;

        /* "chorde/clients/async.py":222
 * 
 *             elif value is _RENEW:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.renew(key, ttl, **(kw or {}))
 *                 except:
 */
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L7_error;
        __pyx_L41_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L45_try_end:;
      }

      /* "chorde/clients/async.py":221
 *                     self.logger.error("Error deleting key", exc_info=True)
 * 
 *             elif value is _RENEW:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.renew(key, ttl, **(kw or {}))
 */
      goto __pyx_L28;
    }

    /* "chorde/clients/async.py":227
 *                     self.logger.error("Error renewing key", exc_info=True)
 * 
 *             elif value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.expire(key)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (__pyx_v_value == __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":228
 * 
 *             elif value is _EXPIRE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.expire(key)
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "chorde/clients/async.py":229
 *             elif value is _EXPIRE:
 *                 try:
 *                     self.client.expire(key)             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error expiring key", exc_info=True)
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L50_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_expire); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L50_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_key);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L50_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "chorde/clients/async.py":228
 * 
 *             elif value is _EXPIRE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.expire(key)
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L55_try_end;
        __pyx_L50_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":230
 *                 try:
 *                     self.client.expire(key)
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error expiring key", exc_info=True)
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(0, 230, __pyx_L52_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_1);

          /* "chorde/clients/async.py":231
 *                     self.client.expire(key)
 *                 except:
 *                     self.logger.error("Error expiring key", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _CLEAR:
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 231, __pyx_L52_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L52_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 231, __pyx_L52_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 231, __pyx_L52_except_error)
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__5, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 231, __pyx_L52_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L51_exception_handled;
        }
        __pyx_L52_except_error:;

        /* "chorde/clients/async.py":228
 * 
 *             elif value is _EXPIRE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.expire(key)
 *                 except:
 */
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        goto __pyx_L7_error;
        __pyx_L51_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        __pyx_L55_try_end:;
      }

      /* "chorde/clients/async.py":227
 *                     self.logger.error("Error renewing key", exc_info=True)
 * 
 *             elif value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.expire(key)
 */
      goto __pyx_L28;
    }

    /* "chorde/clients/async.py":233
 *                     self.logger.error("Error expiring key", exc_info=True)
 * 
 *             elif value is _CLEAR:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.clear()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (__pyx_v_value == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":234
 * 
 *             elif value is _CLEAR:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.clear()
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "chorde/clients/async.py":235
 *             elif value is _CLEAR:
 *                 try:
 *                     self.client.clear()             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error clearing cache", exc_info = True)
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L58_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L58_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L58_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "chorde/clients/async.py":234
 * 
 *             elif value is _CLEAR:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.clear()
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L63_try_end;
        __pyx_L58_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":236
 *                 try:
 *                     self.client.clear()
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error clearing cache", exc_info = True)
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 236, __pyx_L60_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_7);

          /* "chorde/clients/async.py":237
 *                     self.client.clear()
 *                 except:
 *                     self.logger.error("Error clearing cache", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _PURGE:
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 237, __pyx_L60_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 237, __pyx_L60_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 237, __pyx_L60_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 237, __pyx_L60_except_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__6, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L60_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L59_exception_handled;
        }
        __pyx_L60_except_error:;

        /* "chorde/clients/async.py":234
 * 
 *             elif value is _CLEAR:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.clear()
 *                 except:
 */
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L7_error;
        __pyx_L59_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L63_try_end:;
      }

      /* "chorde/clients/async.py":233
 *                     self.logger.error("Error expiring key", exc_info=True)
 * 
 *             elif value is _CLEAR:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.clear()
 */
      goto __pyx_L28;
    }

    /* "chorde/clients/async.py":239
 *                     self.logger.error("Error clearing cache", exc_info = True)
 * 
 *             elif value is _PURGE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.purge()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PURGE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = (__pyx_v_value == __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":240
 * 
 *             elif value is _PURGE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.purge()
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "chorde/clients/async.py":241
 *             elif value is _PURGE:
 *                 try:
 *                     self.client.purge()             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error purging cache", exc_info = True)
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L66_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_purge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L66_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L66_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":240
 * 
 *             elif value is _PURGE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.purge()
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L71_try_end;
        __pyx_L66_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":242
 *                 try:
 *                     self.client.purge()
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error purging cache", exc_info = True)
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 242, __pyx_L68_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);

          /* "chorde/clients/async.py":243
 *                     self.client.purge()
 *                 except:
 *                     self.logger.error("Error purging cache", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L68_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 243, __pyx_L68_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L68_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 243, __pyx_L68_except_error)
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__7, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 243, __pyx_L68_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L67_exception_handled;
        }
        __pyx_L68_except_error:;

        /* "chorde/clients/async.py":240
 * 
 *             elif value is _PURGE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.purge()
 *                 except:
 */
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        goto __pyx_L7_error;
        __pyx_L67_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        __pyx_L71_try_end:;
      }

      /* "chorde/clients/async.py":239
 *                     self.logger.error("Error clearing cache", exc_info = True)
 * 
 *             elif value is _PURGE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.client.purge()
 */
      goto __pyx_L28;
    }

    /* "chorde/clients/async.py":246
 * 
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.put(key, value, ttl, **(kw or {}))
 *                 except:
 */
    /*else*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "chorde/clients/async.py":247
 *             else:
 *                 try:
 *                     self.client.put(key, value, ttl, **(kw or {}))             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.logger.error("Error saving data in cache %r, key %r", self.client, key, exc_info=True)
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L74_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L74_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L74_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
          __Pyx_INCREF(__pyx_v_value);
          __Pyx_GIVEREF(__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
          __Pyx_INCREF(__pyx_v_ttl);
          __Pyx_GIVEREF(__pyx_v_ttl);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ttl);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 247, __pyx_L74_error)
          if (!__pyx_t_4) {
          } else {
            __Pyx_INCREF(__pyx_v_kw);
            __pyx_t_12 = __pyx_v_kw;
            goto __pyx_L80_bool_binop_done;
          }
          __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L74_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_12 = __pyx_t_3;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_L80_bool_binop_done:;
          if (unlikely(__pyx_t_12 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
            __PYX_ERR(0, 247, __pyx_L74_error)
          }
          if (likely(PyDict_CheckExact(__pyx_t_12))) {
            __pyx_t_7 = PyDict_Copy(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L74_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          } else {
            __pyx_t_7 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L74_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 247, __pyx_L74_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "chorde/clients/async.py":246
 * 
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.put(key, value, ttl, **(kw or {}))
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L79_try_end;
        __pyx_L74_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":248
 *                 try:
 *                     self.client.put(key, value, ttl, **(kw or {}))
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.logger.error("Error saving data in cache %r, key %r", self.client, key, exc_info=True)
 * 
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_2);

          /* "chorde/clients/async.py":249
 *                     self.client.put(key, value, ttl, **(kw or {}))
 *                 except:
 *                     self.logger.error("Error saving data in cache %r, key %r", self.client, key, exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             if deferred is not _NONE:
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_INCREF(__pyx_kp_s_Error_saving_data_in_cache_r_key);
          __Pyx_GIVEREF(__pyx_kp_s_Error_saving_data_in_cache_r_key);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_kp_s_Error_saving_data_in_cache_r_key);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1);
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_key);
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 249, __pyx_L76_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L75_exception_handled;
        }
        __pyx_L76_except_error:;

        /* "chorde/clients/async.py":246
 * 
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.client.put(key, value, ttl, **(kw or {}))
 *                 except:
 */
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L7_error;
        __pyx_L75_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L79_try_end:;
      }
    }
    __pyx_L28:;

    /* "chorde/clients/async.py":251
 *                     self.logger.error("Error saving data in cache %r, key %r", self.client, key, exc_info=True)
 * 
 *             if deferred is not _NONE:             # <<<<<<<<<<<<<<
 *                 deferred.done()
 *         finally:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L7_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_deferred != __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":252
 * 
 *             if deferred is not _NONE:
 *                 deferred.done()             # <<<<<<<<<<<<<<
 *         finally:
 *             # Signal waiting threads
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_deferred, __pyx_n_s_done); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "chorde/clients/async.py":251
 *                     self.logger.error("Error saving data in cache %r, key %r", self.client, key, exc_info=True)
 * 
 *             if deferred is not _NONE:             # <<<<<<<<<<<<<<
 *                 deferred.done()
 *         finally:
 */
    }
  }

  /* "chorde/clients/async.py":255
 *         finally:
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)             # <<<<<<<<<<<<<<
 *             if w is not None:
 *                 kev = w[2]
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_key, Py_None};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_key, Py_None};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_15 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_13, __pyx_v_key);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_13, Py_None);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_w = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "chorde/clients/async.py":256
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)
 *             if w is not None:             # <<<<<<<<<<<<<<
 *                 kev = w[2]
 *             else:
 */
      __pyx_t_5 = (__pyx_v_w != Py_None);
      __pyx_t_4 = (__pyx_t_5 != 0);
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":257
 *             w = self.workset.pop(key, None)
 *             if w is not None:
 *                 kev = w[2]             # <<<<<<<<<<<<<<
 *             else:
 *                 kev = None
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_kev = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "chorde/clients/async.py":256
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)
 *             if w is not None:             # <<<<<<<<<<<<<<
 *                 kev = w[2]
 *             else:
 */
        goto __pyx_L85;
      }

      /* "chorde/clients/async.py":259
 *                 kev = w[2]
 *             else:
 *                 kev = None             # <<<<<<<<<<<<<<
 *             del w
 * 
 */
      /*else*/ {
        __Pyx_INCREF(Py_None);
        __pyx_v_kev = Py_None;
      }
      __pyx_L85:;

      /* "chorde/clients/async.py":260
 *             else:
 *                 kev = None
 *             del w             # <<<<<<<<<<<<<<
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 */
      __Pyx_DECREF(__pyx_v_w);
      __pyx_v_w = NULL;

      /* "chorde/clients/async.py":262
 *             del w
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.threadset.remove(thread_id)
 */
      __pyx_t_5 = (__pyx_v_thread_id != Py_None);
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L87_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_operator); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_12, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_int_0);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_15 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_15);
      __pyx_t_2 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_thread_id, __pyx_t_15, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_5 = (__pyx_t_6 != 0);
      __pyx_t_4 = __pyx_t_5;
      __pyx_L87_bool_binop_done:;
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {

            /* "chorde/clients/async.py":264
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:
 *                     self.threadset.remove(thread_id)             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     pass
 */
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L89_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L89_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            __pyx_t_15 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_v_thread_id) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_thread_id);
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 264, __pyx_L89_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

            /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
          }
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L94_try_end;
          __pyx_L89_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":265
 *                 try:
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     pass
 * 
 */
          __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
          if (__pyx_t_13) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L90_exception_handled;
          }
          goto __pyx_L91_except_error;
          __pyx_L91_except_error:;

          /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L90_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          __pyx_L94_try_end:;
        }

        /* "chorde/clients/async.py":262
 *             del w
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.threadset.remove(thread_id)
 */
      }

      /* "chorde/clients/async.py":268
 *                     pass
 * 
 *             ev.set()             # <<<<<<<<<<<<<<
 *             if kev is not None:
 *                 kev.set()
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_15 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "chorde/clients/async.py":269
 * 
 *             ev.set()
 *             if kev is not None:             # <<<<<<<<<<<<<<
 *                 kev.set()
 * 
 */
      __pyx_t_4 = (__pyx_v_kev != Py_None);
      __pyx_t_5 = (__pyx_t_4 != 0);
      if (__pyx_t_5) {

        /* "chorde/clients/async.py":270
 *             ev.set()
 *             if kev is not None:
 *                 kev.set()             # <<<<<<<<<<<<<<
 * 
 *         # Cleanup
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kev, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_15 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "chorde/clients/async.py":269
 * 
 *             ev.set()
 *             if kev is not None:             # <<<<<<<<<<<<<<
 *                 kev.set()
 * 
 */
      }
      goto __pyx_L8;
    }
    __pyx_L7_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
      {

        /* "chorde/clients/async.py":255
 *         finally:
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)             # <<<<<<<<<<<<<<
 *             if w is not None:
 *                 kev = w[2]
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pop); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        __pyx_t_21 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_21 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, Py_None};
          __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 255, __pyx_L97_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_15);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, Py_None};
          __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 255, __pyx_L97_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_15);
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 255, __pyx_L97_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_2) {
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
          }
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_21, __pyx_v_key);
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_21, Py_None);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 255, __pyx_L97_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_w = __pyx_t_15;
        __pyx_t_15 = 0;

        /* "chorde/clients/async.py":256
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)
 *             if w is not None:             # <<<<<<<<<<<<<<
 *                 kev = w[2]
 *             else:
 */
        __pyx_t_5 = (__pyx_v_w != Py_None);
        __pyx_t_4 = (__pyx_t_5 != 0);
        if (__pyx_t_4) {

          /* "chorde/clients/async.py":257
 *             w = self.workset.pop(key, None)
 *             if w is not None:
 *                 kev = w[2]             # <<<<<<<<<<<<<<
 *             else:
 *                 kev = None
 */
          __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 257, __pyx_L97_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_v_kev = __pyx_t_15;
          __pyx_t_15 = 0;

          /* "chorde/clients/async.py":256
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)
 *             if w is not None:             # <<<<<<<<<<<<<<
 *                 kev = w[2]
 *             else:
 */
          goto __pyx_L98;
        }

        /* "chorde/clients/async.py":259
 *                 kev = w[2]
 *             else:
 *                 kev = None             # <<<<<<<<<<<<<<
 *             del w
 * 
 */
        /*else*/ {
          __Pyx_INCREF(Py_None);
          __pyx_v_kev = Py_None;
        }
        __pyx_L98:;

        /* "chorde/clients/async.py":260
 *             else:
 *                 kev = None
 *             del w             # <<<<<<<<<<<<<<
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 */
        __Pyx_DECREF(__pyx_v_w);
        __pyx_v_w = NULL;

        /* "chorde/clients/async.py":262
 *             del w
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.threadset.remove(thread_id)
 */
        __pyx_t_5 = (__pyx_v_thread_id != Py_None);
        __pyx_t_6 = (__pyx_t_5 != 0);
        if (__pyx_t_6) {
        } else {
          __pyx_t_4 = __pyx_t_6;
          goto __pyx_L100_bool_binop_done;
        }
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_operator); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_15 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_int_0);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_12 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
        __pyx_t_15 = 0;
        __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_thread_id, __pyx_t_12, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 262, __pyx_L97_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_5 = (__pyx_t_6 != 0);
        __pyx_t_4 = __pyx_t_5;
        __pyx_L100_bool_binop_done:;
        if (__pyx_t_4) {

          /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            /*try:*/ {

              /* "chorde/clients/async.py":264
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:
 *                     self.threadset.remove(thread_id)             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     pass
 */
              __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L102_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 264, __pyx_L102_error)
              __Pyx_GOTREF(__pyx_t_15);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
                __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
                if (likely(__pyx_t_2)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                  __Pyx_INCREF(__pyx_t_2);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_15, function);
                }
              }
              __pyx_t_12 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_2, __pyx_v_thread_id) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_thread_id);
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 264, __pyx_L102_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

              /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
            }
            __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
            __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
            goto __pyx_L107_try_end;
            __pyx_L102_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "chorde/clients/async.py":265
 *                 try:
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     pass
 * 
 */
            __pyx_t_21 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
            if (__pyx_t_21) {
              __Pyx_ErrRestore(0,0,0);
              goto __pyx_L103_exception_handled;
            }
            goto __pyx_L104_except_error;
            __pyx_L104_except_error:;

            /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            goto __pyx_L97_error;
            __pyx_L103_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            __pyx_L107_try_end:;
          }

          /* "chorde/clients/async.py":262
 *             del w
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.threadset.remove(thread_id)
 */
        }

        /* "chorde/clients/async.py":268
 *                     pass
 * 
 *             ev.set()             # <<<<<<<<<<<<<<
 *             if kev is not None:
 *                 kev.set()
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_set); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_12 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L97_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "chorde/clients/async.py":269
 * 
 *             ev.set()
 *             if kev is not None:             # <<<<<<<<<<<<<<
 *                 kev.set()
 * 
 */
        __pyx_t_4 = (__pyx_v_kev != Py_None);
        __pyx_t_5 = (__pyx_t_4 != 0);
        if (__pyx_t_5) {

          /* "chorde/clients/async.py":270
 *             ev.set()
 *             if kev is not None:
 *                 kev.set()             # <<<<<<<<<<<<<<
 * 
 *         # Cleanup
 */
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_kev, __pyx_n_s_set); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 270, __pyx_L97_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_12 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 270, __pyx_L97_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "chorde/clients/async.py":269
 * 
 *             ev.set()
 *             if kev is not None:             # <<<<<<<<<<<<<<
 *                 kev.set()
 * 
 */
        }
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      }
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
      goto __pyx_L1_error;
      __pyx_L97_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L6_return: {
      __pyx_t_20 = __pyx_r;
      __pyx_r = 0;

      /* "chorde/clients/async.py":255
 *         finally:
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)             # <<<<<<<<<<<<<<
 *             if w is not None:
 *                 kev = w[2]
 */
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_16 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, Py_None};
        __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_key, Py_None};
        __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_15) {
          __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_15); __pyx_t_15 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_16, __pyx_v_key);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_16, Py_None);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_w = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "chorde/clients/async.py":256
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)
 *             if w is not None:             # <<<<<<<<<<<<<<
 *                 kev = w[2]
 *             else:
 */
      __pyx_t_5 = (__pyx_v_w != Py_None);
      __pyx_t_4 = (__pyx_t_5 != 0);
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":257
 *             w = self.workset.pop(key, None)
 *             if w is not None:
 *                 kev = w[2]             # <<<<<<<<<<<<<<
 *             else:
 *                 kev = None
 */
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_w, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_v_kev = __pyx_t_12;
        __pyx_t_12 = 0;

        /* "chorde/clients/async.py":256
 *             # Signal waiting threads
 *             w = self.workset.pop(key, None)
 *             if w is not None:             # <<<<<<<<<<<<<<
 *                 kev = w[2]
 *             else:
 */
        goto __pyx_L109;
      }

      /* "chorde/clients/async.py":259
 *                 kev = w[2]
 *             else:
 *                 kev = None             # <<<<<<<<<<<<<<
 *             del w
 * 
 */
      /*else*/ {
        __Pyx_INCREF(Py_None);
        __pyx_v_kev = Py_None;
      }
      __pyx_L109:;

      /* "chorde/clients/async.py":260
 *             else:
 *                 kev = None
 *             del w             # <<<<<<<<<<<<<<
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 */
      __Pyx_DECREF(__pyx_v_w);
      __pyx_v_w = NULL;

      /* "chorde/clients/async.py":262
 *             del w
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.threadset.remove(thread_id)
 */
      __pyx_t_5 = (__pyx_v_thread_id != Py_None);
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L111_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_operator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_12 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_int_0);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_7);
      __pyx_t_12 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_thread_id, __pyx_t_7, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = (__pyx_t_6 != 0);
      __pyx_t_4 = __pyx_t_5;
      __pyx_L111_bool_binop_done:;
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_18, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "chorde/clients/async.py":264
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:
 *                     self.threadset.remove(thread_id)             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     pass
 */
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 264, __pyx_L113_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 264, __pyx_L113_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_12, function);
              }
            }
            __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_15, __pyx_v_thread_id) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_thread_id);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L113_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
          }
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L118_try_end;
          __pyx_L113_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":265
 *                 try:
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     pass
 * 
 */
          __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
          if (__pyx_t_16) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L114_exception_handled;
          }
          goto __pyx_L115_except_error;
          __pyx_L115_except_error:;

          /* "chorde/clients/async.py":263
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.threadset.remove(thread_id)
 *                 except KeyError:
 */
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_L114_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_11);
          __pyx_L118_try_end:;
        }

        /* "chorde/clients/async.py":262
 *             del w
 * 
 *             if thread_id is not None and thread_id not in map(operator.itemgetter(0), self.workset.values()):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.threadset.remove(thread_id)
 */
      }

      /* "chorde/clients/async.py":268
 *                     pass
 * 
 *             ev.set()             # <<<<<<<<<<<<<<
 *             if kev is not None:
 *                 kev.set()
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_set); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "chorde/clients/async.py":269
 * 
 *             ev.set()
 *             if kev is not None:             # <<<<<<<<<<<<<<
 *                 kev.set()
 * 
 */
      __pyx_t_4 = (__pyx_v_kev != Py_None);
      __pyx_t_5 = (__pyx_t_4 != 0);
      if (__pyx_t_5) {

        /* "chorde/clients/async.py":270
 *             ev.set()
 *             if kev is not None:
 *                 kev.set()             # <<<<<<<<<<<<<<
 * 
 *         # Cleanup
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_kev, __pyx_n_s_set); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":269
 * 
 *             ev.set()
 *             if kev is not None:             # <<<<<<<<<<<<<<
 *                 kev.set()
 * 
 */
      }
      __pyx_r = __pyx_t_20;
      __pyx_t_20 = 0;
      goto __pyx_L0;
    }
    __pyx_L8:;
  }

  /* "chorde/clients/async.py":273
 * 
 *         # Cleanup
 *         try:             # <<<<<<<<<<<<<<
 *             if not hasattr(self.tl, 'dirty_rounds'):
 *                 self.tl.dirty_rounds = 0
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_11, &__pyx_t_18);
    __Pyx_XGOTREF(__pyx_t_20);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_18);
    /*try:*/ {

      /* "chorde/clients/async.py":274
 *         # Cleanup
 *         try:
 *             if not hasattr(self.tl, 'dirty_rounds'):             # <<<<<<<<<<<<<<
 *                 self.tl.dirty_rounds = 0
 *             self.tl.dirty_rounds += 1
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_HasAttr(__pyx_t_7, __pyx_n_s_dirty_rounds); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 274, __pyx_L120_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":275
 *         try:
 *             if not hasattr(self.tl, 'dirty_rounds'):
 *                 self.tl.dirty_rounds = 0             # <<<<<<<<<<<<<<
 *             self.tl.dirty_rounds += 1
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L120_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s_dirty_rounds, __pyx_int_0) < 0) __PYX_ERR(0, 275, __pyx_L120_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":274
 *         # Cleanup
 *         try:
 *             if not hasattr(self.tl, 'dirty_rounds'):             # <<<<<<<<<<<<<<
 *                 self.tl.dirty_rounds = 0
 *             self.tl.dirty_rounds += 1
 */
      }

      /* "chorde/clients/async.py":276
 *             if not hasattr(self.tl, 'dirty_rounds'):
 *                 self.tl.dirty_rounds = 0
 *             self.tl.dirty_rounds += 1             # <<<<<<<<<<<<<<
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:
 *                 self.tl.dirty_rounds = 0
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirty_rounds); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 276, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s_dirty_rounds, __pyx_t_15) < 0) __PYX_ERR(0, 276, __pyx_L120_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "chorde/clients/async.py":277
 *                 self.tl.dirty_rounds = 0
 *             self.tl.dirty_rounds += 1
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:             # <<<<<<<<<<<<<<
 *                 self.tl.dirty_rounds = 0
 *                 for task in self.cleanup_tasks:
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirty_rounds); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_cycles); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_15, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (!__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L128_bool_binop_done;
      }
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 277, __pyx_L120_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_6 = ((!__pyx_t_5) != 0);
      __pyx_t_4 = __pyx_t_6;
      __pyx_L128_bool_binop_done:;
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":278
 *             self.tl.dirty_rounds += 1
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:
 *                 self.tl.dirty_rounds = 0             # <<<<<<<<<<<<<<
 *                 for task in self.cleanup_tasks:
 *                     task()
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tl); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L120_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_PyObject_SetAttrStr(__pyx_t_12, __pyx_n_s_dirty_rounds, __pyx_int_0) < 0) __PYX_ERR(0, 278, __pyx_L120_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "chorde/clients/async.py":279
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:
 *                 self.tl.dirty_rounds = 0
 *                 for task in self.cleanup_tasks:             # <<<<<<<<<<<<<<
 *                     task()
 *                 for task in _global_cleanup_tasks:
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_tasks); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L120_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
          __pyx_t_7 = __pyx_t_12; __Pyx_INCREF(__pyx_t_7); __pyx_t_25 = 0;
          __pyx_t_26 = NULL;
        } else {
          __pyx_t_25 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L120_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_26 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 279, __pyx_L120_error)
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        for (;;) {
          if (likely(!__pyx_t_26)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_25 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_25); __Pyx_INCREF(__pyx_t_12); __pyx_t_25++; if (unlikely(0 < 0)) __PYX_ERR(0, 279, __pyx_L120_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L120_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            } else {
              if (__pyx_t_25 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_25); __Pyx_INCREF(__pyx_t_12); __pyx_t_25++; if (unlikely(0 < 0)) __PYX_ERR(0, 279, __pyx_L120_error)
              #else
              __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L120_error)
              __Pyx_GOTREF(__pyx_t_12);
              #endif
            }
          } else {
            __pyx_t_12 = __pyx_t_26(__pyx_t_7);
            if (unlikely(!__pyx_t_12)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 279, __pyx_L120_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_XDECREF_SET(__pyx_v_task, __pyx_t_12);
          __pyx_t_12 = 0;

          /* "chorde/clients/async.py":280
 *                 self.tl.dirty_rounds = 0
 *                 for task in self.cleanup_tasks:
 *                     task()             # <<<<<<<<<<<<<<
 *                 for task in _global_cleanup_tasks:
 *                     task()
 */
          __Pyx_INCREF(__pyx_v_task);
          __pyx_t_15 = __pyx_v_task; __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_12 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 280, __pyx_L120_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "chorde/clients/async.py":279
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:
 *                 self.tl.dirty_rounds = 0
 *                 for task in self.cleanup_tasks:             # <<<<<<<<<<<<<<
 *                     task()
 *                 for task in _global_cleanup_tasks:
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":281
 *                 for task in self.cleanup_tasks:
 *                     task()
 *                 for task in _global_cleanup_tasks:             # <<<<<<<<<<<<<<
 *                     task()
 *         except:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_global_cleanup_tasks); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L120_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
          __pyx_t_12 = __pyx_t_7; __Pyx_INCREF(__pyx_t_12); __pyx_t_25 = 0;
          __pyx_t_26 = NULL;
        } else {
          __pyx_t_25 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 281, __pyx_L120_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_26 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 281, __pyx_L120_error)
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        for (;;) {
          if (likely(!__pyx_t_26)) {
            if (likely(PyList_CheckExact(__pyx_t_12))) {
              if (__pyx_t_25 >= PyList_GET_SIZE(__pyx_t_12)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_25); __Pyx_INCREF(__pyx_t_7); __pyx_t_25++; if (unlikely(0 < 0)) __PYX_ERR(0, 281, __pyx_L120_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L120_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            } else {
              if (__pyx_t_25 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_25); __Pyx_INCREF(__pyx_t_7); __pyx_t_25++; if (unlikely(0 < 0)) __PYX_ERR(0, 281, __pyx_L120_error)
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L120_error)
              __Pyx_GOTREF(__pyx_t_7);
              #endif
            }
          } else {
            __pyx_t_7 = __pyx_t_26(__pyx_t_12);
            if (unlikely(!__pyx_t_7)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 281, __pyx_L120_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_XDECREF_SET(__pyx_v_task, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "chorde/clients/async.py":282
 *                     task()
 *                 for task in _global_cleanup_tasks:
 *                     task()             # <<<<<<<<<<<<<<
 *         except:
 *             self.logger.error("Error during cleanup", exc_info = True)
 */
          __Pyx_INCREF(__pyx_v_task);
          __pyx_t_15 = __pyx_v_task; __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L120_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":281
 *                 for task in self.cleanup_tasks:
 *                     task()
 *                 for task in _global_cleanup_tasks:             # <<<<<<<<<<<<<<
 *                     task()
 *         except:
 */
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "chorde/clients/async.py":277
 *                 self.tl.dirty_rounds = 0
 *             self.tl.dirty_rounds += 1
 *             if self.tl.dirty_rounds > self.cleanup_cycles or not self.queueset:             # <<<<<<<<<<<<<<
 *                 self.tl.dirty_rounds = 0
 *                 for task in self.cleanup_tasks:
 */
      }

      /* "chorde/clients/async.py":273
 * 
 *         # Cleanup
 *         try:             # <<<<<<<<<<<<<<
 *             if not hasattr(self.tl, 'dirty_rounds'):
 *                 self.tl.dirty_rounds = 0
 */
    }
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    goto __pyx_L125_try_end;
    __pyx_L120_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "chorde/clients/async.py":283
 *                 for task in _global_cleanup_tasks:
 *                     task()
 *         except:             # <<<<<<<<<<<<<<
 *             self.logger.error("Error during cleanup", exc_info = True)
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_7, &__pyx_t_15) < 0) __PYX_ERR(0, 283, __pyx_L122_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_15);

      /* "chorde/clients/async.py":284
 *                     task()
 *         except:
 *             self.logger.error("Error during cleanup", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L122_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L122_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L122_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 284, __pyx_L122_except_error)
      __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 284, __pyx_L122_except_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L121_exception_handled;
    }
    __pyx_L122_except_error:;

    /* "chorde/clients/async.py":273
 * 
 *         # Cleanup
 *         try:             # <<<<<<<<<<<<<<
 *             if not hasattr(self.tl, 'dirty_rounds'):
 *                 self.tl.dirty_rounds = 0
 */
    __Pyx_XGIVEREF(__pyx_t_20);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_18);
    __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_11, __pyx_t_18);
    goto __pyx_L1_error;
    __pyx_L121_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_20);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_18);
    __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_11, __pyx_t_18);
    __pyx_L125_try_end:;
  }

  /* "chorde/clients/async.py":166
 * 
 *     @staticmethod
 *     def _writer(self, key, reentrant = True):             # <<<<<<<<<<<<<<
 *         # self is weakref
 *         self = self()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_thread_id);
  __Pyx_XDECREF(__pyx_v_ev);
  __Pyx_XDECREF(__pyx_v_deferred);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_ttl);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_kev);
  __Pyx_XDECREF(__pyx_v_task);
  __Pyx_XDECREF(__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":287
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_9capacity(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_9capacity = {"capacity", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_9capacity, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_9capacity(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_8capacity(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_8capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("capacity", 0);

  /* "chorde/clients/async.py":288
 *     @property
 *     def capacity(self):
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":287
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":291
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return len(self.queueset)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_11usage(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_11usage = {"usage", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_11usage, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_11usage(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("usage (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_10usage(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_10usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("usage", 0);

  /* "chorde/clients/async.py":292
 *     @property
 *     def usage(self):
 *         return len(self.queueset)             # <<<<<<<<<<<<<<
 * 
 *     @serialize
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":291
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return len(self.queueset)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.usage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":295
 * 
 *     @serialize
 *     def dequeue(self, key):             # <<<<<<<<<<<<<<
 *         rv = self.queueset.pop(key, _NONE)
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_13dequeue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_13dequeue = {"dequeue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_13dequeue, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_13dequeue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dequeue (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dequeue", 1, 2, 2, 1); __PYX_ERR(0, 295, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dequeue") < 0)) __PYX_ERR(0, 295, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dequeue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 295, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.dequeue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_12dequeue(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_12dequeue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dequeue", 0);

  /* "chorde/clients/async.py":296
 *     @serialize
 *     def dequeue(self, key):
 *         rv = self.queueset.pop(key, _NONE)             # <<<<<<<<<<<<<<
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()
 *         return rv
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_rv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":297
 *     def dequeue(self, key):
 *         rv = self.queueset.pop(key, _NONE)
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_ident); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_rv);
  __Pyx_GIVEREF(__pyx_v_rv);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_rv);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_key, __pyx_t_2) < 0)) __PYX_ERR(0, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":298
 *         rv = self.queueset.pop(key, _NONE)
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @serialize
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "chorde/clients/async.py":295
 * 
 *     @serialize
 *     def dequeue(self, key):             # <<<<<<<<<<<<<<
 *         rv = self.queueset.pop(key, _NONE)
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.dequeue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":301
 * 
 *     @serialize
 *     def drop_one(self):             # <<<<<<<<<<<<<<
 *         for key in self.queueset:
 *             break
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_15drop_one(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_15drop_one = {"drop_one", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_15drop_one, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_15drop_one(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drop_one (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_14drop_one(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_14drop_one(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drop_one", 0);

  /* "chorde/clients/async.py":302
 *     @serialize
 *     def drop_one(self):
 *         for key in self.queueset:             # <<<<<<<<<<<<<<
 *             break
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 302, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_key = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":303
 *     def drop_one(self):
 *         for key in self.queueset:
 *             break             # <<<<<<<<<<<<<<
 *         else:
 *             return
 */
    goto __pyx_L4_break;

    /* "chorde/clients/async.py":302
 *     @serialize
 *     def drop_one(self):
 *         for key in self.queueset:             # <<<<<<<<<<<<<<
 *             break
 *         else:
 */
  }
  /*else*/ {

    /* "chorde/clients/async.py":305
 *             break
 *         else:
 *             return             # <<<<<<<<<<<<<<
 *         rv = self.queueset.pop(key, _NONE)
 *         return rv
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":302
 *     @serialize
 *     def drop_one(self):
 *         for key in self.queueset:             # <<<<<<<<<<<<<<
 *             break
 *         else:
 */
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":306
 *         else:
 *             return
 *         rv = self.queueset.pop(key, _NONE)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_key, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_key, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "chorde/clients/async.py":307
 *             return
 *         rv = self.queueset.pop(key, _NONE)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "chorde/clients/async.py":301
 * 
 *     @serialize
 *     def drop_one(self):             # <<<<<<<<<<<<<<
 *         for key in self.queueset:
 *             break
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.drop_one", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":309
 *         return rv
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):             # <<<<<<<<<<<<<<
 *         if (thread.get_ident() in self.threadset
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_17enqueue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_17enqueue = {"enqueue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_17enqueue, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_17enqueue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enqueue (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("enqueue", 0, 3, 4, 1); __PYX_ERR(0, 309, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("enqueue", 0, 3, 4, 2); __PYX_ERR(0, 309, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "enqueue") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("enqueue", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.enqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_16enqueue(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_16enqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_queueset = NULL;
  PyObject *__pyx_v_delayed = NULL;
  CYTHON_UNUSED long __pyx_v__;
  PyObject *__pyx_v_ev = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  long __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enqueue", 0);

  /* "chorde/clients/async.py":310
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):
 *         if (thread.get_ident() in self.threadset             # <<<<<<<<<<<<<<
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 *             # Oops, recursive call, bad idea
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_ident); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "chorde/clients/async.py":311
 *     def enqueue(self, key, value, ttl=None, **kw):
 *         if (thread.get_ident() in self.threadset
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):             # <<<<<<<<<<<<<<
 *             # Oops, recursive call, bad idea
 *             # Run inline
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_s_in_worker); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_worker); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;

  /* "chorde/clients/async.py":310
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):
 *         if (thread.get_ident() in self.threadset             # <<<<<<<<<<<<<<
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 *             # Oops, recursive call, bad idea
 */
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":314
 *             # Oops, recursive call, bad idea
 *             # Run inline
 *             queueset = self.queueset             # <<<<<<<<<<<<<<
 *             if key in queueset:
 *                 delayed = self._coalesce(key, value, ttl, **kw)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_queueset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "chorde/clients/async.py":315
 *             # Run inline
 *             queueset = self.queueset
 *             if key in queueset:             # <<<<<<<<<<<<<<
 *                 delayed = self._coalesce(key, value, ttl, **kw)
 *                 if delayed is not None:
 */
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_queueset, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 315, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":316
 *             queueset = self.queueset
 *             if key in queueset:
 *                 delayed = self._coalesce(key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 *                 if delayed is not None:
 *                     # delayed callback, invoke now that we're outside the critical section
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_ttl);
      __Pyx_GIVEREF(__pyx_v_ttl);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_ttl);
      __pyx_t_2 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_delayed = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "chorde/clients/async.py":317
 *             if key in queueset:
 *                 delayed = self._coalesce(key, value, ttl, **kw)
 *                 if delayed is not None:             # <<<<<<<<<<<<<<
 *                     # delayed callback, invoke now that we're outside the critical section
 *                     delayed()
 */
      __pyx_t_5 = (__pyx_v_delayed != Py_None);
      __pyx_t_1 = (__pyx_t_5 != 0);
      if (__pyx_t_1) {

        /* "chorde/clients/async.py":319
 *                 if delayed is not None:
 *                     # delayed callback, invoke now that we're outside the critical section
 *                     delayed()             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._writer(self._wself, key)
 */
        __Pyx_INCREF(__pyx_v_delayed);
        __pyx_t_2 = __pyx_v_delayed; __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":317
 *             if key in queueset:
 *                 delayed = self._coalesce(key, value, ttl, **kw)
 *                 if delayed is not None:             # <<<<<<<<<<<<<<
 *                     # delayed callback, invoke now that we're outside the critical section
 *                     delayed()
 */
        goto __pyx_L8;
      }

      /* "chorde/clients/async.py":321
 *                     delayed()
 *                 else:
 *                     self._writer(self._wself, key)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.queueset[key] = value, ttl, (kw or None)
 */
      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wself); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_key};
          __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_key};
          __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_key);
          __pyx_t_3 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L8:;

      /* "chorde/clients/async.py":315
 *             # Run inline
 *             queueset = self.queueset
 *             if key in queueset:             # <<<<<<<<<<<<<<
 *                 delayed = self._coalesce(key, value, ttl, **kw)
 *                 if delayed is not None:
 */
      goto __pyx_L7;
    }

    /* "chorde/clients/async.py":323
 *                     self._writer(self._wself, key)
 *             else:
 *                 self.queueset[key] = value, ttl, (kw or None)             # <<<<<<<<<<<<<<
 *                 self._writer(self._wself, key)
 *         else:
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
      if (!__pyx_t_1) {
      } else {
        __Pyx_INCREF(__pyx_v_kw);
        __pyx_t_7 = __pyx_v_kw;
        goto __pyx_L9_bool_binop_done;
      }
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
      __pyx_L9_bool_binop_done:;
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_ttl);
      __Pyx_GIVEREF(__pyx_v_ttl);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ttl);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_key, __pyx_t_2) < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "chorde/clients/async.py":324
 *             else:
 *                 self.queueset[key] = value, ttl, (kw or None)
 *                 self._writer(self._wself, key)             # <<<<<<<<<<<<<<
 *         else:
 *             if key not in self.queueset:
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wself); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_9, __pyx_v_key};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_9, __pyx_v_key};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_9);
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_key);
        __pyx_t_9 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L7:;

    /* "chorde/clients/async.py":310
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):
 *         if (thread.get_ident() in self.threadset             # <<<<<<<<<<<<<<
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 *             # Oops, recursive call, bad idea
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":326
 *                 self._writer(self._wself, key)
 *         else:
 *             if key not in self.queueset:             # <<<<<<<<<<<<<<
 *                 if self.overflow:
 *                     # use overflow semantics: remove old entries to make room for new ones
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":327
 *         else:
 *             if key not in self.queueset:
 *                 if self.overflow:             # <<<<<<<<<<<<<<
 *                     # use overflow semantics: remove old entries to make room for new ones
 *                     if len(self.queueset) >= self.size:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_overflow); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_5) {

        /* "chorde/clients/async.py":329
 *                 if self.overflow:
 *                     # use overflow semantics: remove old entries to make room for new ones
 *                     if len(self.queueset) >= self.size:             # <<<<<<<<<<<<<<
 *                         # just two, tit-for-tat, one in, two out. Avoids large latencies,
 *                         # and guarantees stable sizes, around, while not strictly below "size"
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 329, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_5) {

          /* "chorde/clients/async.py":332
 *                         # just two, tit-for-tat, one in, two out. Avoids large latencies,
 *                         # and guarantees stable sizes, around, while not strictly below "size"
 *                         for _ in xrange(2):             # <<<<<<<<<<<<<<
 *                             self.drop_one()
 *                             if len(self.queueset) < self.size:
 */
          for (__pyx_t_11 = 0; __pyx_t_11 < 2; __pyx_t_11+=1) {
            __pyx_v__ = __pyx_t_11;

            /* "chorde/clients/async.py":333
 *                         # and guarantees stable sizes, around, while not strictly below "size"
 *                         for _ in xrange(2):
 *                             self.drop_one()             # <<<<<<<<<<<<<<
 *                             if len(self.queueset) < self.size:
 *                                 break
 */
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_drop_one); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_7, function);
              }
            }
            __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "chorde/clients/async.py":334
 *                         for _ in xrange(2):
 *                             self.drop_one()
 *                             if len(self.queueset) < self.size:             # <<<<<<<<<<<<<<
 *                                 break
 *                 elif not is_special(value):
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_10 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 334, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (__pyx_t_5) {

              /* "chorde/clients/async.py":335
 *                             self.drop_one()
 *                             if len(self.queueset) < self.size:
 *                                 break             # <<<<<<<<<<<<<<
 *                 elif not is_special(value):
 *                     # blocking semantics, wait
 */
              goto __pyx_L15_break;

              /* "chorde/clients/async.py":334
 *                         for _ in xrange(2):
 *                             self.drop_one()
 *                             if len(self.queueset) < self.size:             # <<<<<<<<<<<<<<
 *                                 break
 *                 elif not is_special(value):
 */
            }
          }
          __pyx_L15_break:;

          /* "chorde/clients/async.py":329
 *                 if self.overflow:
 *                     # use overflow semantics: remove old entries to make room for new ones
 *                     if len(self.queueset) >= self.size:             # <<<<<<<<<<<<<<
 *                         # just two, tit-for-tat, one in, two out. Avoids large latencies,
 *                         # and guarantees stable sizes, around, while not strictly below "size"
 */
        }

        /* "chorde/clients/async.py":327
 *         else:
 *             if key not in self.queueset:
 *                 if self.overflow:             # <<<<<<<<<<<<<<
 *                     # use overflow semantics: remove old entries to make room for new ones
 *                     if len(self.queueset) >= self.size:
 */
        goto __pyx_L12;
      }

      /* "chorde/clients/async.py":336
 *                             if len(self.queueset) < self.size:
 *                                 break
 *                 elif not is_special(value):             # <<<<<<<<<<<<<<
 *                     # blocking semantics, wait
 *                     ev = self.done_event
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_is_special); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((!__pyx_t_5) != 0);
      if (__pyx_t_1) {

        /* "chorde/clients/async.py":338
 *                 elif not is_special(value):
 *                     # blocking semantics, wait
 *                     ev = self.done_event             # <<<<<<<<<<<<<<
 *                     while len(self.queueset) >= self.size:
 *                         ev.wait(1.0)
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_done_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_ev = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "chorde/clients/async.py":339
 *                     # blocking semantics, wait
 *                     ev = self.done_event
 *                     while len(self.queueset) >= self.size:             # <<<<<<<<<<<<<<
 *                         ev.wait(1.0)
 *                         if ev.isSet():
 */
        while (1) {
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 339, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (!__pyx_t_1) break;

          /* "chorde/clients/async.py":340
 *                     ev = self.done_event
 *                     while len(self.queueset) >= self.size:
 *                         ev.wait(1.0)             # <<<<<<<<<<<<<<
 *                         if ev.isSet():
 *                             ev.clear()
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_wait); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_float_1_0) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_float_1_0);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "chorde/clients/async.py":341
 *                     while len(self.queueset) >= self.size:
 *                         ev.wait(1.0)
 *                         if ev.isSet():             # <<<<<<<<<<<<<<
 *                             ev.clear()
 *             delayed = self._enqueue(key, value, ttl, **kw)
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_isSet); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_1) {

            /* "chorde/clients/async.py":342
 *                         ev.wait(1.0)
 *                         if ev.isSet():
 *                             ev.clear()             # <<<<<<<<<<<<<<
 *             delayed = self._enqueue(key, value, ttl, **kw)
 *             if delayed is not None:
 */
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_clear); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_7, function);
              }
            }
            __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "chorde/clients/async.py":341
 *                     while len(self.queueset) >= self.size:
 *                         ev.wait(1.0)
 *                         if ev.isSet():             # <<<<<<<<<<<<<<
 *                             ev.clear()
 *             delayed = self._enqueue(key, value, ttl, **kw)
 */
          }
        }

        /* "chorde/clients/async.py":336
 *                             if len(self.queueset) < self.size:
 *                                 break
 *                 elif not is_special(value):             # <<<<<<<<<<<<<<
 *                     # blocking semantics, wait
 *                     ev = self.done_event
 */
      }
      __pyx_L12:;

      /* "chorde/clients/async.py":326
 *                 self._writer(self._wself, key)
 *         else:
 *             if key not in self.queueset:             # <<<<<<<<<<<<<<
 *                 if self.overflow:
 *                     # use overflow semantics: remove old entries to make room for new ones
 */
    }

    /* "chorde/clients/async.py":343
 *                         if ev.isSet():
 *                             ev.clear()
 *             delayed = self._enqueue(key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 *             if delayed is not None:
 *                 # delayed callback, invoke now that we're outside the critical section
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_value);
    __Pyx_INCREF(__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_ttl);
    __pyx_t_2 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_delayed = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "chorde/clients/async.py":344
 *                             ev.clear()
 *             delayed = self._enqueue(key, value, ttl, **kw)
 *             if delayed is not None:             # <<<<<<<<<<<<<<
 *                 # delayed callback, invoke now that we're outside the critical section
 *                 delayed()
 */
    __pyx_t_1 = (__pyx_v_delayed != Py_None);
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "chorde/clients/async.py":346
 *             if delayed is not None:
 *                 # delayed callback, invoke now that we're outside the critical section
 *                 delayed()             # <<<<<<<<<<<<<<
 * 
 *     @serialize
 */
      __Pyx_INCREF(__pyx_v_delayed);
      __pyx_t_2 = __pyx_v_delayed; __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_9 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "chorde/clients/async.py":344
 *                             ev.clear()
 *             delayed = self._enqueue(key, value, ttl, **kw)
 *             if delayed is not None:             # <<<<<<<<<<<<<<
 *                 # delayed callback, invoke now that we're outside the critical section
 *                 delayed()
 */
    }
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":309
 *         return rv
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):             # <<<<<<<<<<<<<<
 *         if (thread.get_ident() in self.threadset
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.enqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_queueset);
  __Pyx_XDECREF(__pyx_v_delayed);
  __Pyx_XDECREF(__pyx_v_ev);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":349
 * 
 *     @serialize
 *     def clearqueue(self):             # <<<<<<<<<<<<<<
 *         delayed = []
 *         for entry in self.queueset.itervalues():
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_19clearqueue(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_19clearqueue = {"clearqueue", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_19clearqueue, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_19clearqueue(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clearqueue (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_18clearqueue(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_18clearqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_delayed = NULL;
  PyObject *__pyx_v_entry = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_future = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clearqueue", 0);

  /* "chorde/clients/async.py":350
 *     @serialize
 *     def clearqueue(self):
 *         delayed = []             # <<<<<<<<<<<<<<
 *         for entry in self.queueset.itervalues():
 *             value = entry[0]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delayed = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":351
 *     def clearqueue(self):
 *         delayed = []
 *         for entry in self.queueset.itervalues():             # <<<<<<<<<<<<<<
 *             value = entry[0]
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):
 */
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "itervalues");
    __PYX_ERR(0, 351, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_itervalues, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "chorde/clients/async.py":352
 *         delayed = []
 *         for entry in self.queueset.itervalues():
 *             value = entry[0]             # <<<<<<<<<<<<<<
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):
 *                 future = getattr(value, 'future', None)
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "chorde/clients/async.py":353
 *         for entry in self.queueset.itervalues():
 *             value = entry[0]
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):             # <<<<<<<<<<<<<<
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 */
    __pyx_t_9 = __Pyx_HasAttr(__pyx_v_value, __pyx_n_s_undefer); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 353, __pyx_L1_error)
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_8 = __pyx_t_10;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_10 = __Pyx_HasAttr(__pyx_v_value, __pyx_n_s_future); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 353, __pyx_L1_error)
    __pyx_t_9 = (__pyx_t_10 != 0);
    __pyx_t_8 = __pyx_t_9;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_8) {

      /* "chorde/clients/async.py":354
 *             value = entry[0]
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):
 *                 future = getattr(value, 'future', None)             # <<<<<<<<<<<<<<
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 *                     delayed.append(future.cancel)
 */
      __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_value, __pyx_n_s_future, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_future, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "chorde/clients/async.py":355
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):             # <<<<<<<<<<<<<<
 *                     delayed.append(future.cancel)
 *         self.queueset.clear()
 */
      __pyx_t_9 = (__pyx_v_future != Py_None);
      __pyx_t_10 = (__pyx_t_9 != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_HasAttr(__pyx_v_future, __pyx_n_s_add_done_callback); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 355, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_10 != 0);
      __pyx_t_8 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_8) {

        /* "chorde/clients/async.py":356
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 *                     delayed.append(future.cancel)             # <<<<<<<<<<<<<<
 *         self.queueset.clear()
 *         return delayed
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_cancel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_delayed, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 356, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "chorde/clients/async.py":355
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):             # <<<<<<<<<<<<<<
 *                     delayed.append(future.cancel)
 *         self.queueset.clear()
 */
      }

      /* "chorde/clients/async.py":353
 *         for entry in self.queueset.itervalues():
 *             value = entry[0]
 *             if hasattr(value, 'undefer') and hasattr(value, 'future'):             # <<<<<<<<<<<<<<
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 */
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":357
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 *                     delayed.append(future.cancel)
 *         self.queueset.clear()             # <<<<<<<<<<<<<<
 *         return delayed
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":358
 *                     delayed.append(future.cancel)
 *         self.queueset.clear()
 *         return delayed             # <<<<<<<<<<<<<<
 * 
 *     def _coalesce(self, key, value, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_delayed);
  __pyx_r = __pyx_v_delayed;
  goto __pyx_L0;

  /* "chorde/clients/async.py":349
 * 
 *     @serialize
 *     def clearqueue(self):             # <<<<<<<<<<<<<<
 *         delayed = []
 *         for entry in self.queueset.itervalues():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.clearqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delayed);
  __Pyx_XDECREF(__pyx_v_entry);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_future);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":360
 *         return delayed
 * 
 *     def _coalesce(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_21_coalesce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_21_coalesce = {"_coalesce", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_21_coalesce, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_21_coalesce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_coalesce (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_coalesce", 1, 4, 4, 1); __PYX_ERR(0, 360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_coalesce", 1, 4, 4, 2); __PYX_ERR(0, 360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_coalesce", 1, 4, 4, 3); __PYX_ERR(0, 360, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "_coalesce") < 0)) __PYX_ERR(0, 360, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_coalesce", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._coalesce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_20_coalesce(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_20_coalesce(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_delayed = NULL;
  PyObject *__pyx_v_queueset = NULL;
  PyObject *__pyx_v_future = NULL;
  PyObject *__pyx_v_queue_value = NULL;
  PyObject *__pyx_v_queue_future = NULL;
  PyObject *__pyx_v_queue_ttl = NULL;
  PyObject *__pyx_v_queue_kwargs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_coalesce", 0);

  /* "chorde/clients/async.py":361
 * 
 *     def _coalesce(self, key, value, ttl, **kw):
 *         delayed = None             # <<<<<<<<<<<<<<
 *         queueset = self.queueset
 *         if hasattr(value, 'undefer'):
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_delayed = Py_None;

  /* "chorde/clients/async.py":362
 *     def _coalesce(self, key, value, ttl, **kw):
 *         delayed = None
 *         queueset = self.queueset             # <<<<<<<<<<<<<<
 *         if hasattr(value, 'undefer'):
 *             # Queued one wins, we just have to chain the futures if any
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_queueset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":363
 *         delayed = None
 *         queueset = self.queueset
 *         if hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *             # Queued one wins, we just have to chain the futures if any
 *             future = getattr(value, 'future', None)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_value, __pyx_n_s_undefer); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":365
 *         if hasattr(value, 'undefer'):
 *             # Queued one wins, we just have to chain the futures if any
 *             future = getattr(value, 'future', None)             # <<<<<<<<<<<<<<
 *             if future is not None and hasattr(future, 'add_done_callback'):
 *                 queue_value = queueset.get(key)
 */
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_value, __pyx_n_s_future, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_future = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":366
 *             # Queued one wins, we just have to chain the futures if any
 *             future = getattr(value, 'future', None)
 *             if future is not None and hasattr(future, 'add_done_callback'):             # <<<<<<<<<<<<<<
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:
 */
    __pyx_t_2 = (__pyx_v_future != Py_None);
    __pyx_t_4 = (__pyx_t_2 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_future, __pyx_n_s_add_done_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_4 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_3) {

      /* "chorde/clients/async.py":367
 *             future = getattr(value, 'future', None)
 *             if future is not None and hasattr(future, 'add_done_callback'):
 *                 queue_value = queueset.get(key)             # <<<<<<<<<<<<<<
 *                 if queue_value is not None:
 *                     # Ok, they'll wanna get the value when it's done
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_queueset, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_key);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_queue_value = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "chorde/clients/async.py":368
 *             if future is not None and hasattr(future, 'add_done_callback'):
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:             # <<<<<<<<<<<<<<
 *                     # Ok, they'll wanna get the value when it's done
 *                     queue_value = queue_value[0]
 */
      __pyx_t_3 = (__pyx_v_queue_value != Py_None);
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":370
 *                 if queue_value is not None:
 *                     # Ok, they'll wanna get the value when it's done
 *                     queue_value = queue_value[0]             # <<<<<<<<<<<<<<
 *                     if hasattr(queue_value, 'undefer'):
 *                         queue_future = getattr(queue_value, 'future', None)
 */
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_queue_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_queue_value, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "chorde/clients/async.py":371
 *                     # Ok, they'll wanna get the value when it's done
 *                     queue_value = queue_value[0]
 *                     if hasattr(queue_value, 'undefer'):             # <<<<<<<<<<<<<<
 *                         queue_future = getattr(queue_value, 'future', None)
 *                         if queue_future is not None:
 */
        __pyx_t_2 = __Pyx_HasAttr(__pyx_v_queue_value, __pyx_n_s_undefer); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 371, __pyx_L1_error)
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {

          /* "chorde/clients/async.py":372
 *                     queue_value = queue_value[0]
 *                     if hasattr(queue_value, 'undefer'):
 *                         queue_future = getattr(queue_value, 'future', None)             # <<<<<<<<<<<<<<
 *                         if queue_future is not None:
 *                             delayed = functools.partial(queue_future.chain, future)
 */
          __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_queue_value, __pyx_n_s_future, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_queue_future = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "chorde/clients/async.py":373
 *                     if hasattr(queue_value, 'undefer'):
 *                         queue_future = getattr(queue_value, 'future', None)
 *                         if queue_future is not None:             # <<<<<<<<<<<<<<
 *                             delayed = functools.partial(queue_future.chain, future)
 *                         else:
 */
          __pyx_t_3 = (__pyx_v_queue_future != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {

            /* "chorde/clients/async.py":374
 *                         queue_future = getattr(queue_value, 'future', None)
 *                         if queue_future is not None:
 *                             delayed = functools.partial(queue_future.chain, future)             # <<<<<<<<<<<<<<
 *                         else:
 *                             queue_value.future = future
 */
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_functools); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_partial); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue_future, __pyx_n_s_chain); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = NULL;
            __pyx_t_8 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_6, function);
                __pyx_t_8 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_6)) {
              PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_future};
              __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
              PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_future};
              __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            } else
            #endif
            {
              __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 374, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_9);
              if (__pyx_t_7) {
                __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
              }
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
              __Pyx_INCREF(__pyx_v_future);
              __Pyx_GIVEREF(__pyx_v_future);
              PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_future);
              __pyx_t_5 = 0;
              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "chorde/clients/async.py":373
 *                     if hasattr(queue_value, 'undefer'):
 *                         queue_future = getattr(queue_value, 'future', None)
 *                         if queue_future is not None:             # <<<<<<<<<<<<<<
 *                             delayed = functools.partial(queue_future.chain, future)
 *                         else:
 */
            goto __pyx_L9;
          }

          /* "chorde/clients/async.py":376
 *                             delayed = functools.partial(queue_future.chain, future)
 *                         else:
 *                             queue_value.future = future             # <<<<<<<<<<<<<<
 *                     else:
 *                         # Why not
 */
          /*else*/ {
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_queue_value, __pyx_n_s_future, __pyx_v_future) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
          }
          __pyx_L9:;

          /* "chorde/clients/async.py":371
 *                     # Ok, they'll wanna get the value when it's done
 *                     queue_value = queue_value[0]
 *                     if hasattr(queue_value, 'undefer'):             # <<<<<<<<<<<<<<
 *                         queue_future = getattr(queue_value, 'future', None)
 *                         if queue_future is not None:
 */
          goto __pyx_L8;
        }

        /* "chorde/clients/async.py":379
 *                     else:
 *                         # Why not
 *                         delayed = functools.partial(future.set, queue_value)             # <<<<<<<<<<<<<<
 *             else:
 *                 queue_value = queueset.get(key)
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_functools); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_partial); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = NULL;
          __pyx_t_8 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
              __pyx_t_8 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_9)) {
            PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_queue_value};
            __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
            PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_queue_value};
            __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
            }
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_6);
            __Pyx_INCREF(__pyx_v_queue_value);
            __Pyx_GIVEREF(__pyx_v_queue_value);
            PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_queue_value);
            __pyx_t_6 = 0;
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_1);
          __pyx_t_1 = 0;
        }
        __pyx_L8:;

        /* "chorde/clients/async.py":368
 *             if future is not None and hasattr(future, 'add_done_callback'):
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:             # <<<<<<<<<<<<<<
 *                     # Ok, they'll wanna get the value when it's done
 *                     queue_value = queue_value[0]
 */
      }

      /* "chorde/clients/async.py":366
 *             # Queued one wins, we just have to chain the futures if any
 *             future = getattr(value, 'future', None)
 *             if future is not None and hasattr(future, 'add_done_callback'):             # <<<<<<<<<<<<<<
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:
 */
      goto __pyx_L4;
    }

    /* "chorde/clients/async.py":381
 *                         delayed = functools.partial(future.set, queue_value)
 *             else:
 *                 queue_value = queueset.get(key)             # <<<<<<<<<<<<<<
 *                 if queue_value is not None:
 *                     queue_value, queue_ttl, queue_kwargs = queue_value
 */
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_queueset, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_key);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_queue_value = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "chorde/clients/async.py":382
 *             else:
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:             # <<<<<<<<<<<<<<
 *                     queue_value, queue_ttl, queue_kwargs = queue_value
 *                     if queue_value is _RENEW:
 */
      __pyx_t_2 = (__pyx_v_queue_value != Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":383
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:
 *                     queue_value, queue_ttl, queue_kwargs = queue_value             # <<<<<<<<<<<<<<
 *                     if queue_value is _RENEW:
 *                         # Turn renew + put serial operations into a single renew-then-put defer
 */
        if ((likely(PyTuple_CheckExact(__pyx_v_queue_value))) || (PyList_CheckExact(__pyx_v_queue_value))) {
          PyObject* sequence = __pyx_v_queue_value;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 383, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          #else
          __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          Py_ssize_t index = -1;
          __pyx_t_6 = PyObject_GetIter(__pyx_v_queue_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext;
          index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_1);
          index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 2; __pyx_t_7 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_6), 3) < 0) __PYX_ERR(0, 383, __pyx_L1_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L12_unpacking_done;
          __pyx_L11_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 383, __pyx_L1_error)
          __pyx_L12_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_queue_value, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_v_queue_ttl = __pyx_t_9;
        __pyx_t_9 = 0;
        __pyx_v_queue_kwargs = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "chorde/clients/async.py":384
 *                 if queue_value is not None:
 *                     queue_value, queue_ttl, queue_kwargs = queue_value
 *                     if queue_value is _RENEW:             # <<<<<<<<<<<<<<
 *                         # Turn renew + put serial operations into a single renew-then-put defer
 *                         queueset[key] = (
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = (__pyx_v_queue_value == __pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {

          /* "chorde/clients/async.py":387
 *                         # Turn renew + put serial operations into a single renew-then-put defer
 *                         queueset[key] = (
 *                             Defer(_renew_undefer, self._wself, key, queue_ttl, queue_kwargs, value),             # <<<<<<<<<<<<<<
 *                             ttl,
 *                             (kw or None)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Defer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_renew_undefer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wself); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = NULL;
          __pyx_t_8 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
              __pyx_t_8 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_9)) {
            PyObject *__pyx_temp[7] = {__pyx_t_5, __pyx_t_1, __pyx_t_6, __pyx_v_key, __pyx_v_queue_ttl, __pyx_v_queue_kwargs, __pyx_v_value};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 6+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
            PyObject *__pyx_temp[7] = {__pyx_t_5, __pyx_t_1, __pyx_t_6, __pyx_v_key, __pyx_v_queue_ttl, __pyx_v_queue_kwargs, __pyx_v_value};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 6+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(6+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 387, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
            }
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_6);
            __Pyx_INCREF(__pyx_v_key);
            __Pyx_GIVEREF(__pyx_v_key);
            PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_v_key);
            __Pyx_INCREF(__pyx_v_queue_ttl);
            __Pyx_GIVEREF(__pyx_v_queue_ttl);
            PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_8, __pyx_v_queue_ttl);
            __Pyx_INCREF(__pyx_v_queue_kwargs);
            __Pyx_GIVEREF(__pyx_v_queue_kwargs);
            PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_8, __pyx_v_queue_kwargs);
            __Pyx_INCREF(__pyx_v_value);
            __Pyx_GIVEREF(__pyx_v_value);
            PyTuple_SET_ITEM(__pyx_t_11, 5+__pyx_t_8, __pyx_v_value);
            __pyx_t_1 = 0;
            __pyx_t_6 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "chorde/clients/async.py":389
 *                             Defer(_renew_undefer, self._wself, key, queue_ttl, queue_kwargs, value),
 *                             ttl,
 *                             (kw or None)             # <<<<<<<<<<<<<<
 *                         )
 *         else:
 */
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
          if (!__pyx_t_2) {
          } else {
            __Pyx_INCREF(__pyx_v_kw);
            __pyx_t_9 = __pyx_v_kw;
            goto __pyx_L14_bool_binop_done;
          }
          __Pyx_INCREF(Py_None);
          __pyx_t_9 = Py_None;
          __pyx_L14_bool_binop_done:;

          /* "chorde/clients/async.py":387
 *                         # Turn renew + put serial operations into a single renew-then-put defer
 *                         queueset[key] = (
 *                             Defer(_renew_undefer, self._wself, key, queue_ttl, queue_kwargs, value),             # <<<<<<<<<<<<<<
 *                             ttl,
 *                             (kw or None)
 */
          __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
          __Pyx_INCREF(__pyx_v_ttl);
          __Pyx_GIVEREF(__pyx_v_ttl);
          PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_ttl);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_9);
          __pyx_t_7 = 0;
          __pyx_t_9 = 0;

          /* "chorde/clients/async.py":386
 *                     if queue_value is _RENEW:
 *                         # Turn renew + put serial operations into a single renew-then-put defer
 *                         queueset[key] = (             # <<<<<<<<<<<<<<
 *                             Defer(_renew_undefer, self._wself, key, queue_ttl, queue_kwargs, value),
 *                             ttl,
 */
          if (unlikely(PyObject_SetItem(__pyx_v_queueset, __pyx_v_key, __pyx_t_11) < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "chorde/clients/async.py":384
 *                 if queue_value is not None:
 *                     queue_value, queue_ttl, queue_kwargs = queue_value
 *                     if queue_value is _RENEW:             # <<<<<<<<<<<<<<
 *                         # Turn renew + put serial operations into a single renew-then-put defer
 *                         queueset[key] = (
 */
        }

        /* "chorde/clients/async.py":382
 *             else:
 *                 queue_value = queueset.get(key)
 *                 if queue_value is not None:             # <<<<<<<<<<<<<<
 *                     queue_value, queue_ttl, queue_kwargs = queue_value
 *                     if queue_value is _RENEW:
 */
      }
    }
    __pyx_L4:;

    /* "chorde/clients/async.py":363
 *         delayed = None
 *         queueset = self.queueset
 *         if hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *             # Queued one wins, we just have to chain the futures if any
 *             future = getattr(value, 'future', None)
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":393
 *         else:
 *             # New one wins, we just have to chain any queued future
 *             queue_value = queueset.get(key)             # <<<<<<<<<<<<<<
 *             if queue_value is not None:
 *                 # Ok, they'll wanna get the value when it's done
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_queueset, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_key);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_queue_value = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "chorde/clients/async.py":394
 *             # New one wins, we just have to chain any queued future
 *             queue_value = queueset.get(key)
 *             if queue_value is not None:             # <<<<<<<<<<<<<<
 *                 # Ok, they'll wanna get the value when it's done
 *                 queue_value = queue_value[0]
 */
    __pyx_t_2 = (__pyx_v_queue_value != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "chorde/clients/async.py":396
 *             if queue_value is not None:
 *                 # Ok, they'll wanna get the value when it's done
 *                 queue_value = queue_value[0]             # <<<<<<<<<<<<<<
 *                 if hasattr(queue_value, 'undefer'):
 *                     queue_future = getattr(queue_value, 'future', None)
 */
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_queue_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_queue_value, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "chorde/clients/async.py":397
 *                 # Ok, they'll wanna get the value when it's done
 *                 queue_value = queue_value[0]
 *                 if hasattr(queue_value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     queue_future = getattr(queue_value, 'future', None)
 *                     if queue_future is not None:
 */
      __pyx_t_3 = __Pyx_HasAttr(__pyx_v_queue_value, __pyx_n_s_undefer); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 397, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":398
 *                 queue_value = queue_value[0]
 *                 if hasattr(queue_value, 'undefer'):
 *                     queue_future = getattr(queue_value, 'future', None)             # <<<<<<<<<<<<<<
 *                     if queue_future is not None:
 *                         # Delay the callback, we're in a critical section here
 */
        __pyx_t_11 = __Pyx_GetAttr3(__pyx_v_queue_value, __pyx_n_s_future, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 398, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_v_queue_future = __pyx_t_11;
        __pyx_t_11 = 0;

        /* "chorde/clients/async.py":399
 *                 if hasattr(queue_value, 'undefer'):
 *                     queue_future = getattr(queue_value, 'future', None)
 *                     if queue_future is not None:             # <<<<<<<<<<<<<<
 *                         # Delay the callback, we're in a critical section here
 *                         delayed = functools.partial(queue_future.set, value)
 */
        __pyx_t_2 = (__pyx_v_queue_future != Py_None);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {

          /* "chorde/clients/async.py":401
 *                     if queue_future is not None:
 *                         # Delay the callback, we're in a critical section here
 *                         delayed = functools.partial(queue_future.set, value)             # <<<<<<<<<<<<<<
 *             queueset[key] = value, ttl, (kw or None)
 *         return delayed
 */
          __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_functools); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_partial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_queue_future, __pyx_n_s_set); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_6 = NULL;
          __pyx_t_8 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
              __pyx_t_8 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_9, __pyx_v_value};
            __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_9, __pyx_v_value};
            __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (__pyx_t_6) {
              __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
            }
            __Pyx_GIVEREF(__pyx_t_9);
            PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_t_9);
            __Pyx_INCREF(__pyx_v_value);
            __Pyx_GIVEREF(__pyx_v_value);
            PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_v_value);
            __pyx_t_9 = 0;
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_11);
          __pyx_t_11 = 0;

          /* "chorde/clients/async.py":399
 *                 if hasattr(queue_value, 'undefer'):
 *                     queue_future = getattr(queue_value, 'future', None)
 *                     if queue_future is not None:             # <<<<<<<<<<<<<<
 *                         # Delay the callback, we're in a critical section here
 *                         delayed = functools.partial(queue_future.set, value)
 */
        }

        /* "chorde/clients/async.py":397
 *                 # Ok, they'll wanna get the value when it's done
 *                 queue_value = queue_value[0]
 *                 if hasattr(queue_value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     queue_future = getattr(queue_value, 'future', None)
 *                     if queue_future is not None:
 */
      }

      /* "chorde/clients/async.py":394
 *             # New one wins, we just have to chain any queued future
 *             queue_value = queueset.get(key)
 *             if queue_value is not None:             # <<<<<<<<<<<<<<
 *                 # Ok, they'll wanna get the value when it's done
 *                 queue_value = queue_value[0]
 */
    }

    /* "chorde/clients/async.py":402
 *                         # Delay the callback, we're in a critical section here
 *                         delayed = functools.partial(queue_future.set, value)
 *             queueset[key] = value, ttl, (kw or None)             # <<<<<<<<<<<<<<
 *         return delayed
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 402, __pyx_L1_error)
    if (!__pyx_t_3) {
    } else {
      __Pyx_INCREF(__pyx_v_kw);
      __pyx_t_11 = __pyx_v_kw;
      goto __pyx_L19_bool_binop_done;
    }
    __Pyx_INCREF(Py_None);
    __pyx_t_11 = Py_None;
    __pyx_L19_bool_binop_done:;
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_value);
    __Pyx_INCREF(__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_11);
    __pyx_t_11 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_queueset, __pyx_v_key, __pyx_t_7) < 0)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":403
 *                         delayed = functools.partial(queue_future.set, value)
 *             queueset[key] = value, ttl, (kw or None)
 *         return delayed             # <<<<<<<<<<<<<<
 * 
 *     @serialize
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_delayed);
  __pyx_r = __pyx_v_delayed;
  goto __pyx_L0;

  /* "chorde/clients/async.py":360
 *         return delayed
 * 
 *     def _coalesce(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._coalesce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delayed);
  __Pyx_XDECREF(__pyx_v_queueset);
  __Pyx_XDECREF(__pyx_v_future);
  __Pyx_XDECREF(__pyx_v_queue_value);
  __Pyx_XDECREF(__pyx_v_queue_future);
  __Pyx_XDECREF(__pyx_v_queue_ttl);
  __Pyx_XDECREF(__pyx_v_queue_kwargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":406
 * 
 *     @serialize
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_isinstance);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_isinstance);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_isinstance);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_getattr);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_hasattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_23_enqueue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_23_enqueue = {"_enqueue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_23_enqueue, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_23_enqueue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  CYTHON_UNUSED PyObject *__pyx_v_isinstance = 0;
  PyObject *__pyx_v_getattr = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_enqueue (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,&__pyx_n_s_isinstance,&__pyx_n_s_getattr,&__pyx_n_s_hasattr,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[4] = __pyx_dynamic_args->__pyx_arg_isinstance;
    values[5] = __pyx_dynamic_args->__pyx_arg_getattr;
    values[6] = __pyx_dynamic_args->__pyx_arg_hasattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_enqueue", 0, 4, 7, 1); __PYX_ERR(0, 406, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_enqueue", 0, 4, 7, 2); __PYX_ERR(0, 406, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_enqueue", 0, 4, 7, 3); __PYX_ERR(0, 406, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isinstance);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "_enqueue") < 0)) __PYX_ERR(0, 406, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
    __pyx_v_isinstance = values[4];
    __pyx_v_getattr = values[5];
    __pyx_v_hasattr = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_enqueue", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 406, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._enqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_22_enqueue(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_isinstance, __pyx_v_getattr, __pyx_v_hasattr, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_22_enqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, CYTHON_UNUSED PyObject *__pyx_v_isinstance, PyObject *__pyx_v_getattr, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_delayed = NULL;
  PyObject *__pyx_v_queueset = NULL;
  PyObject *__pyx_v_workset = NULL;
  PyObject *__pyx_v_threadpool = NULL;
  int __pyx_v_reentrant;
  PyObject *__pyx_v_future = NULL;
  PyObject *__pyx_v_working = NULL;
  PyObject *__pyx_v_working_future = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_enqueue", 0);

  /* "chorde/clients/async.py":407
 *     @serialize
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):
 *         delayed = None             # <<<<<<<<<<<<<<
 *         queueset = self.queueset
 *         workset = self.workset
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_delayed = Py_None;

  /* "chorde/clients/async.py":408
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):
 *         delayed = None
 *         queueset = self.queueset             # <<<<<<<<<<<<<<
 *         workset = self.workset
 *         if key not in queueset:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_queueset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":409
 *         delayed = None
 *         queueset = self.queueset
 *         workset = self.workset             # <<<<<<<<<<<<<<
 *         if key not in queueset:
 *             if not hasattr(value, 'undefer') or key not in workset:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_workset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":410
 *         queueset = self.queueset
 *         workset = self.workset
 *         if key not in queueset:             # <<<<<<<<<<<<<<
 *             if not hasattr(value, 'undefer') or key not in workset:
 *                 if hasattr(value, 'undefer'):
 */
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_queueset, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":411
 *         workset = self.workset
 *         if key not in queueset:
 *             if not hasattr(value, 'undefer') or key not in workset:             # <<<<<<<<<<<<<<
 *                 if hasattr(value, 'undefer'):
 *                     threadpool = self.defer_threadpool
 */
    __Pyx_INCREF(__pyx_v_hasattr);
    __pyx_t_4 = __pyx_v_hasattr; __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_value, __pyx_n_s_undefer};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_value, __pyx_n_s_undefer};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_value);
      __Pyx_INCREF(__pyx_n_s_undefer);
      __Pyx_GIVEREF(__pyx_n_s_undefer);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_undefer);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = ((!__pyx_t_2) != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_3 = __pyx_t_8;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_workset, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_8 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_3) {

      /* "chorde/clients/async.py":412
 *         if key not in queueset:
 *             if not hasattr(value, 'undefer') or key not in workset:
 *                 if hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     threadpool = self.defer_threadpool
 *                     reentrant = True
 */
      __Pyx_INCREF(__pyx_v_hasattr);
      __pyx_t_4 = __pyx_v_hasattr; __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_value, __pyx_n_s_undefer};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_value, __pyx_n_s_undefer};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_value);
        __Pyx_INCREF(__pyx_n_s_undefer);
        __Pyx_GIVEREF(__pyx_n_s_undefer);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_undefer);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":413
 *             if not hasattr(value, 'undefer') or key not in workset:
 *                 if hasattr(value, 'undefer'):
 *                     threadpool = self.defer_threadpool             # <<<<<<<<<<<<<<
 *                     reentrant = True
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_threadpool = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "chorde/clients/async.py":414
 *                 if hasattr(value, 'undefer'):
 *                     threadpool = self.defer_threadpool
 *                     reentrant = True             # <<<<<<<<<<<<<<
 *                 else:
 *                     threadpool = self.writer_threadpool
 */
        __pyx_v_reentrant = 1;

        /* "chorde/clients/async.py":412
 *         if key not in queueset:
 *             if not hasattr(value, 'undefer') or key not in workset:
 *                 if hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     threadpool = self.defer_threadpool
 *                     reentrant = True
 */
        goto __pyx_L7;
      }

      /* "chorde/clients/async.py":416
 *                     reentrant = True
 *                 else:
 *                     threadpool = self.writer_threadpool             # <<<<<<<<<<<<<<
 *                     reentrant = False
 *                 queueset[key] = value, ttl, (kw or None)
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_threadpool = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "chorde/clients/async.py":417
 *                 else:
 *                     threadpool = self.writer_threadpool
 *                     reentrant = False             # <<<<<<<<<<<<<<
 *                 queueset[key] = value, ttl, (kw or None)
 *                 threadpool.apply_async(self._writer, (self._wself, key, reentrant))
 */
        __pyx_v_reentrant = 0;
      }
      __pyx_L7:;

      /* "chorde/clients/async.py":418
 *                     threadpool = self.writer_threadpool
 *                     reentrant = False
 *                 queueset[key] = value, ttl, (kw or None)             # <<<<<<<<<<<<<<
 *                 threadpool.apply_async(self._writer, (self._wself, key, reentrant))
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
      if (!__pyx_t_3) {
      } else {
        __Pyx_INCREF(__pyx_v_kw);
        __pyx_t_1 = __pyx_v_kw;
        goto __pyx_L8_bool_binop_done;
      }
      __Pyx_INCREF(Py_None);
      __pyx_t_1 = Py_None;
      __pyx_L8_bool_binop_done:;
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_ttl);
      __Pyx_GIVEREF(__pyx_v_ttl);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ttl);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_queueset, __pyx_v_key, __pyx_t_4) < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "chorde/clients/async.py":419
 *                     reentrant = False
 *                 queueset[key] = value, ttl, (kw or None)
 *                 threadpool.apply_async(self._writer, (self._wself, key, reentrant))             # <<<<<<<<<<<<<<
 *             else:
 *                 # else, bad luck, we assume defers compute, so if two
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_threadpool, __pyx_n_s_apply_async); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wself); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_reentrant); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
      __pyx_t_7 = 0;
      __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_10};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_10};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_10);
        __pyx_t_5 = 0;
        __pyx_t_10 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "chorde/clients/async.py":411
 *         workset = self.workset
 *         if key not in queueset:
 *             if not hasattr(value, 'undefer') or key not in workset:             # <<<<<<<<<<<<<<
 *                 if hasattr(value, 'undefer'):
 *                     threadpool = self.defer_threadpool
 */
      goto __pyx_L4;
    }

    /* "chorde/clients/async.py":427
 * 
 *                 # ...if the defer has a future attached
 *                 future = getattr(value, 'future', None)             # <<<<<<<<<<<<<<
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 *                     # we do have to hook into the future though...
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_getattr);
      __pyx_t_1 = __pyx_v_getattr; __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_value, __pyx_n_s_future, Py_None};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_value, __pyx_n_s_future, Py_None};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_v_value);
        __Pyx_INCREF(__pyx_n_s_future);
        __Pyx_GIVEREF(__pyx_n_s_future);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_n_s_future);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_6, Py_None);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_future = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "chorde/clients/async.py":428
 *                 # ...if the defer has a future attached
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):             # <<<<<<<<<<<<<<
 *                     # we do have to hook into the future though...
 *                     working = workset.get(key)
 */
      __pyx_t_2 = (__pyx_v_future != Py_None);
      __pyx_t_8 = (__pyx_t_2 != 0);
      if (__pyx_t_8) {
      } else {
        __pyx_t_3 = __pyx_t_8;
        goto __pyx_L11_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_hasattr);
      __pyx_t_1 = __pyx_v_hasattr; __pyx_t_10 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_future, __pyx_n_s_add_done_callback};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_future, __pyx_n_s_add_done_callback};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_future);
        __Pyx_GIVEREF(__pyx_v_future);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_future);
        __Pyx_INCREF(__pyx_n_s_add_done_callback);
        __Pyx_GIVEREF(__pyx_n_s_add_done_callback);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_add_done_callback);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __pyx_t_8;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":430
 *                 if future is not None and hasattr(future, 'add_done_callback'):
 *                     # we do have to hook into the future though...
 *                     working = workset.get(key)             # <<<<<<<<<<<<<<
 *                     if working is not None:
 *                         working = working[1]
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_workset, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_key);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_working = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "chorde/clients/async.py":431
 *                     # we do have to hook into the future though...
 *                     working = workset.get(key)
 *                     if working is not None:             # <<<<<<<<<<<<<<
 *                         working = working[1]
 *                         if working is not _NONE:
 */
        __pyx_t_3 = (__pyx_v_working != Py_None);
        __pyx_t_8 = (__pyx_t_3 != 0);
        if (__pyx_t_8) {

          /* "chorde/clients/async.py":432
 *                     working = workset.get(key)
 *                     if working is not None:
 *                         working = working[1]             # <<<<<<<<<<<<<<
 *                         if working is not _NONE:
 *                             working = working[0]
 */
          __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_working, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_working, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "chorde/clients/async.py":433
 *                     if working is not None:
 *                         working = working[1]
 *                         if working is not _NONE:             # <<<<<<<<<<<<<<
 *                             working = working[0]
 *                         if hasattr(working, 'undefer'):
 */
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_8 = (__pyx_v_working != __pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_3 = (__pyx_t_8 != 0);
          if (__pyx_t_3) {

            /* "chorde/clients/async.py":434
 *                         working = working[1]
 *                         if working is not _NONE:
 *                             working = working[0]             # <<<<<<<<<<<<<<
 *                         if hasattr(working, 'undefer'):
 *                             working_future = getattr(working, 'future', None)
 */
            __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_working, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF_SET(__pyx_v_working, __pyx_t_4);
            __pyx_t_4 = 0;

            /* "chorde/clients/async.py":433
 *                     if working is not None:
 *                         working = working[1]
 *                         if working is not _NONE:             # <<<<<<<<<<<<<<
 *                             working = working[0]
 *                         if hasattr(working, 'undefer'):
 */
          }

          /* "chorde/clients/async.py":435
 *                         if working is not _NONE:
 *                             working = working[0]
 *                         if hasattr(working, 'undefer'):             # <<<<<<<<<<<<<<
 *                             working_future = getattr(working, 'future', None)
 *                             if working_future is not None and hasattr(working_future, 'chain'):
 */
          __Pyx_INCREF(__pyx_v_hasattr);
          __pyx_t_1 = __pyx_v_hasattr; __pyx_t_7 = NULL;
          __pyx_t_6 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_6 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_working, __pyx_n_s_undefer};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
            PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_working, __pyx_n_s_undefer};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 435, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            if (__pyx_t_7) {
              __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
            }
            __Pyx_INCREF(__pyx_v_working);
            __Pyx_GIVEREF(__pyx_v_working);
            PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_v_working);
            __Pyx_INCREF(__pyx_n_s_undefer);
            __Pyx_GIVEREF(__pyx_n_s_undefer);
            PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_n_s_undefer);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_3) {

            /* "chorde/clients/async.py":436
 *                             working = working[0]
 *                         if hasattr(working, 'undefer'):
 *                             working_future = getattr(working, 'future', None)             # <<<<<<<<<<<<<<
 *                             if working_future is not None and hasattr(working_future, 'chain'):
 *                                 delayed = functools.partial(working_future.chain, future)
 */
            __Pyx_INCREF(__pyx_v_getattr);
            __pyx_t_1 = __pyx_v_getattr; __pyx_t_10 = NULL;
            __pyx_t_6 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_10)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_10);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_6 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_1)) {
              PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_working, __pyx_n_s_future, Py_None};
              __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
              PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_working, __pyx_n_s_future, Py_None};
              __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else
            #endif
            {
              __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (__pyx_t_10) {
                __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL;
              }
              __Pyx_INCREF(__pyx_v_working);
              __Pyx_GIVEREF(__pyx_v_working);
              PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_working);
              __Pyx_INCREF(__pyx_n_s_future);
              __Pyx_GIVEREF(__pyx_n_s_future);
              PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_future);
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_v_working_future = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "chorde/clients/async.py":437
 *                         if hasattr(working, 'undefer'):
 *                             working_future = getattr(working, 'future', None)
 *                             if working_future is not None and hasattr(working_future, 'chain'):             # <<<<<<<<<<<<<<
 *                                 delayed = functools.partial(working_future.chain, future)
 *                             elif getattr(working, 'rv', _NONE) is not _NONE:
 */
            __pyx_t_8 = (__pyx_v_working_future != Py_None);
            __pyx_t_2 = (__pyx_t_8 != 0);
            if (__pyx_t_2) {
            } else {
              __pyx_t_3 = __pyx_t_2;
              goto __pyx_L17_bool_binop_done;
            }
            __Pyx_INCREF(__pyx_v_hasattr);
            __pyx_t_1 = __pyx_v_hasattr; __pyx_t_7 = NULL;
            __pyx_t_6 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_6 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_1)) {
              PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_working_future, __pyx_n_s_chain};
              __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
              PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_working_future, __pyx_n_s_chain};
              __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_GOTREF(__pyx_t_4);
            } else
            #endif
            {
              __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 437, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              if (__pyx_t_7) {
                __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
              }
              __Pyx_INCREF(__pyx_v_working_future);
              __Pyx_GIVEREF(__pyx_v_working_future);
              PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_v_working_future);
              __Pyx_INCREF(__pyx_n_s_chain);
              __Pyx_GIVEREF(__pyx_n_s_chain);
              PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_n_s_chain);
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_3 = __pyx_t_2;
            __pyx_L17_bool_binop_done:;
            if (__pyx_t_3) {

              /* "chorde/clients/async.py":438
 *                             working_future = getattr(working, 'future', None)
 *                             if working_future is not None and hasattr(working_future, 'chain'):
 *                                 delayed = functools.partial(working_future.chain, future)             # <<<<<<<<<<<<<<
 *                             elif getattr(working, 'rv', _NONE) is not _NONE:
 *                                 # Delay the callback, we're in a critical section here
 */
              __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_functools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_partial); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 438, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_working_future, __pyx_n_s_chain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_7 = NULL;
              __pyx_t_6 = 0;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
                __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
                if (likely(__pyx_t_7)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                  __Pyx_INCREF(__pyx_t_7);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_10, function);
                  __pyx_t_6 = 1;
                }
              }
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_10)) {
                PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_v_future};
                __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
                PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_v_future};
                __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              } else
              #endif
              {
                __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                if (__pyx_t_7) {
                  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
                }
                __Pyx_GIVEREF(__pyx_t_1);
                PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_1);
                __Pyx_INCREF(__pyx_v_future);
                __Pyx_GIVEREF(__pyx_v_future);
                PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_future);
                __pyx_t_1 = 0;
                __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              }
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_4);
              __pyx_t_4 = 0;

              /* "chorde/clients/async.py":437
 *                         if hasattr(working, 'undefer'):
 *                             working_future = getattr(working, 'future', None)
 *                             if working_future is not None and hasattr(working_future, 'chain'):             # <<<<<<<<<<<<<<
 *                                 delayed = functools.partial(working_future.chain, future)
 *                             elif getattr(working, 'rv', _NONE) is not _NONE:
 */
              goto __pyx_L16;
            }

            /* "chorde/clients/async.py":439
 *                             if working_future is not None and hasattr(working_future, 'chain'):
 *                                 delayed = functools.partial(working_future.chain, future)
 *                             elif getattr(working, 'rv', _NONE) is not _NONE:             # <<<<<<<<<<<<<<
 *                                 # Delay the callback, we're in a critical section here
 *                                 delayed = functools.partial(future.set, working.rv)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NONE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 439, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_v_getattr);
            __pyx_t_5 = __pyx_v_getattr; __pyx_t_1 = NULL;
            __pyx_t_6 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
                __pyx_t_6 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_working, __pyx_n_s_rv, __pyx_t_10};
              __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
              PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_working, __pyx_n_s_rv, __pyx_t_10};
              __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else
            #endif
            {
              __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (__pyx_t_1) {
                __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
              }
              __Pyx_INCREF(__pyx_v_working);
              __Pyx_GIVEREF(__pyx_v_working);
              PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_working);
              __Pyx_INCREF(__pyx_n_s_rv);
              __Pyx_GIVEREF(__pyx_n_s_rv);
              PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_rv);
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = (__pyx_t_4 != __pyx_t_5);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {

              /* "chorde/clients/async.py":441
 *                             elif getattr(working, 'rv', _NONE) is not _NONE:
 *                                 # Delay the callback, we're in a critical section here
 *                                 delayed = functools.partial(future.set, working.rv)             # <<<<<<<<<<<<<<
 *                             else:
 *                                 working.future = future
 */
              __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_functools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_partial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_working, __pyx_n_s_rv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 441, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_1 = NULL;
              __pyx_t_6 = 0;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
                __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
                if (likely(__pyx_t_1)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_1);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_7, function);
                  __pyx_t_6 = 1;
                }
              }
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_7)) {
                PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_10};
                __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
                PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_10};
                __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error)
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              } else
              #endif
              {
                __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 441, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_1) {
                  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL;
                }
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_10);
                PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_t_10);
                __pyx_t_4 = 0;
                __pyx_t_10 = 0;
                __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              }
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_5);
              __pyx_t_5 = 0;

              /* "chorde/clients/async.py":439
 *                             if working_future is not None and hasattr(working_future, 'chain'):
 *                                 delayed = functools.partial(working_future.chain, future)
 *                             elif getattr(working, 'rv', _NONE) is not _NONE:             # <<<<<<<<<<<<<<
 *                                 # Delay the callback, we're in a critical section here
 *                                 delayed = functools.partial(future.set, working.rv)
 */
              goto __pyx_L16;
            }

            /* "chorde/clients/async.py":443
 *                                 delayed = functools.partial(future.set, working.rv)
 *                             else:
 *                                 working.future = future             # <<<<<<<<<<<<<<
 *                         else:
 *                             # Delay the callback, we're in a critical section here
 */
            /*else*/ {
              if (__Pyx_PyObject_SetAttrStr(__pyx_v_working, __pyx_n_s_future, __pyx_v_future) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
            }
            __pyx_L16:;

            /* "chorde/clients/async.py":435
 *                         if working is not _NONE:
 *                             working = working[0]
 *                         if hasattr(working, 'undefer'):             # <<<<<<<<<<<<<<
 *                             working_future = getattr(working, 'future', None)
 *                             if working_future is not None and hasattr(working_future, 'chain'):
 */
            goto __pyx_L15;
          }

          /* "chorde/clients/async.py":446
 *                         else:
 *                             # Delay the callback, we're in a critical section here
 *                             delayed = functools.partial(future.set, working)             # <<<<<<<<<<<<<<
 *         else:
 *             delayed = self._coalesce(key, value, ttl, **kw)
 */
          /*else*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_functools); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_partial); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 446, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_future, __pyx_n_s_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_10 = NULL;
            __pyx_t_6 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
              if (likely(__pyx_t_10)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
                __Pyx_INCREF(__pyx_t_10);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_9, function);
                __pyx_t_6 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_7, __pyx_v_working};
              __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
              PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_7, __pyx_v_working};
              __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error)
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            } else
            #endif
            {
              __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              if (__pyx_t_10) {
                __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL;
              }
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_7);
              __Pyx_INCREF(__pyx_v_working);
              __Pyx_GIVEREF(__pyx_v_working);
              PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_working);
              __pyx_t_7 = 0;
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            }
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_5);
            __pyx_t_5 = 0;
          }
          __pyx_L15:;

          /* "chorde/clients/async.py":431
 *                     # we do have to hook into the future though...
 *                     working = workset.get(key)
 *                     if working is not None:             # <<<<<<<<<<<<<<
 *                         working = working[1]
 *                         if working is not _NONE:
 */
        }

        /* "chorde/clients/async.py":428
 *                 # ...if the defer has a future attached
 *                 future = getattr(value, 'future', None)
 *                 if future is not None and hasattr(future, 'add_done_callback'):             # <<<<<<<<<<<<<<
 *                     # we do have to hook into the future though...
 *                     working = workset.get(key)
 */
      }
    }
    __pyx_L4:;

    /* "chorde/clients/async.py":410
 *         queueset = self.queueset
 *         workset = self.workset
 *         if key not in queueset:             # <<<<<<<<<<<<<<
 *             if not hasattr(value, 'undefer') or key not in workset:
 *                 if hasattr(value, 'undefer'):
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":448
 *                             delayed = functools.partial(future.set, working)
 *         else:
 *             delayed = self._coalesce(key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 *         return delayed
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_value);
    __Pyx_INCREF(__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_ttl);
    __pyx_t_4 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_7);
    __pyx_t_7 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":449
 *         else:
 *             delayed = self._coalesce(key, value, ttl, **kw)
 *         return delayed             # <<<<<<<<<<<<<<
 * 
 *     def waitkey(self, key, timeout=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_delayed);
  __pyx_r = __pyx_v_delayed;
  goto __pyx_L0;

  /* "chorde/clients/async.py":406
 * 
 *     @serialize
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._enqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delayed);
  __Pyx_XDECREF(__pyx_v_queueset);
  __Pyx_XDECREF(__pyx_v_workset);
  __Pyx_XDECREF(__pyx_v_threadpool);
  __Pyx_XDECREF(__pyx_v_future);
  __Pyx_XDECREF(__pyx_v_working);
  __Pyx_XDECREF(__pyx_v_working_future);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":451
 *         return delayed
 * 
 *     def waitkey(self, key, timeout=None):             # <<<<<<<<<<<<<<
 *         tid = thread.get_ident()
 *         if (tid in self.threadset
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_25waitkey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_25waitkey = {"waitkey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_25waitkey, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_25waitkey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("waitkey (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_timeout,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("waitkey", 0, 2, 3, 1); __PYX_ERR(0, 451, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "waitkey") < 0)) __PYX_ERR(0, 451, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_timeout = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("waitkey", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 451, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.waitkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_24waitkey(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_timeout);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_24waitkey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_v_tid = NULL;
  PyObject *__pyx_v_tidt = NULL;
  PyObject *__pyx_v_queueset = NULL;
  PyObject *__pyx_v_workset_get = NULL;
  PyObject *__pyx_v_done_event = NULL;
  PyObject *__pyx_v_sleep = NULL;
  PyObject *__pyx_v_busyloop = NULL;
  PyObject *__pyx_v_ev = NULL;
  PyObject *__pyx_v_done = NULL;
  PyObject *__pyx_v_time_time = NULL;
  PyObject *__pyx_v_tfin = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  double __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("waitkey", 0);
  __Pyx_INCREF(__pyx_v_timeout);

  /* "chorde/clients/async.py":452
 * 
 *     def waitkey(self, key, timeout=None):
 *         tid = thread.get_ident()             # <<<<<<<<<<<<<<
 *         if (tid in self.threadset
 *                 or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker())):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_ident); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_tid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":453
 *     def waitkey(self, key, timeout=None):
 *         tid = thread.get_ident()
 *         if (tid in self.threadset             # <<<<<<<<<<<<<<
 *                 or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker())):
 *             # Oops, recursive call, bad idea
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_tid, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "chorde/clients/async.py":454
 *         tid = thread.get_ident()
 *         if (tid in self.threadset
 *                 or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker())):             # <<<<<<<<<<<<<<
 *             # Oops, recursive call, bad idea
 *             return
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_in_worker); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_in_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;

  /* "chorde/clients/async.py":453
 *     def waitkey(self, key, timeout=None):
 *         tid = thread.get_ident()
 *         if (tid in self.threadset             # <<<<<<<<<<<<<<
 *                 or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker())):
 *             # Oops, recursive call, bad idea
 */
  if (__pyx_t_4) {

    /* "chorde/clients/async.py":456
 *                 or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker())):
 *             # Oops, recursive call, bad idea
 *             return             # <<<<<<<<<<<<<<
 * 
 *         tidt = (tid,)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "chorde/clients/async.py":453
 *     def waitkey(self, key, timeout=None):
 *         tid = thread.get_ident()
 *         if (tid in self.threadset             # <<<<<<<<<<<<<<
 *                 or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker())):
 *             # Oops, recursive call, bad idea
 */
  }

  /* "chorde/clients/async.py":458
 *             return
 * 
 *         tidt = (tid,)             # <<<<<<<<<<<<<<
 *         queueset = self.queueset
 *         workset_get = self.workset.get
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tid);
  __pyx_v_tidt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":459
 * 
 *         tidt = (tid,)
 *         queueset = self.queueset             # <<<<<<<<<<<<<<
 *         workset_get = self.workset.get
 *         done_event = self.done_event
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_queueset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":460
 *         tidt = (tid,)
 *         queueset = self.queueset
 *         workset_get = self.workset.get             # <<<<<<<<<<<<<<
 *         done_event = self.done_event
 *         sleep = time.sleep
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_workset_get = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "chorde/clients/async.py":461
 *         queueset = self.queueset
 *         workset_get = self.workset.get
 *         done_event = self.done_event             # <<<<<<<<<<<<<<
 *         sleep = time.sleep
 *         busyloop = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_done_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_done_event = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "chorde/clients/async.py":462
 *         workset_get = self.workset.get
 *         done_event = self.done_event
 *         sleep = time.sleep             # <<<<<<<<<<<<<<
 *         busyloop = 0
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sleep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sleep = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":463
 *         done_event = self.done_event
 *         sleep = time.sleep
 *         busyloop = 0             # <<<<<<<<<<<<<<
 * 
 *         if timeout is None:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_busyloop = __pyx_int_0;

  /* "chorde/clients/async.py":465
 *         busyloop = 0
 * 
 *         if timeout is None:             # <<<<<<<<<<<<<<
 *             # contains inlined for speed in code below
 *             while (key in queueset or workset_get(key, tidt)[0] != tid):
 */
  __pyx_t_4 = (__pyx_v_timeout == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":467
 *         if timeout is None:
 *             # contains inlined for speed in code below
 *             while (key in queueset or workset_get(key, tidt)[0] != tid):             # <<<<<<<<<<<<<<
 *                 ev = workset_get(key)
 *                 if ev is not None:
 */
    while (1) {
      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_queueset, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 467, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_4 != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L10_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_workset_get);
      __pyx_t_2 = __pyx_v_workset_get; __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_key);
        __Pyx_INCREF(__pyx_v_tidt);
        __Pyx_GIVEREF(__pyx_v_tidt);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_tidt);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_tid, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 467, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __pyx_t_6;
      __pyx_L10_bool_binop_done:;
      if (!__pyx_t_5) break;

      /* "chorde/clients/async.py":468
 *             # contains inlined for speed in code below
 *             while (key in queueset or workset_get(key, tidt)[0] != tid):
 *                 ev = workset_get(key)             # <<<<<<<<<<<<<<
 *                 if ev is not None:
 *                     ev = ev[2]
 */
      __Pyx_INCREF(__pyx_v_workset_get);
      __pyx_t_2 = __pyx_v_workset_get; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_ev, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "chorde/clients/async.py":469
 *             while (key in queueset or workset_get(key, tidt)[0] != tid):
 *                 ev = workset_get(key)
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 */
      __pyx_t_5 = (__pyx_v_ev != Py_None);
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {

        /* "chorde/clients/async.py":470
 *                 ev = workset_get(key)
 *                 if ev is not None:
 *                     ev = ev[2]             # <<<<<<<<<<<<<<
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event
 */
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ev, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_ev, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "chorde/clients/async.py":469
 *             while (key in queueset or workset_get(key, tidt)[0] != tid):
 *                 ev = workset_get(key)
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 */
        goto __pyx_L12;
      }

      /* "chorde/clients/async.py":471
 *                 if ev is not None:
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):             # <<<<<<<<<<<<<<
 *                     ev = done_event
 *                 if ev is not None:
 */
      __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_queueset, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 471, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_5 != 0);
      if (!__pyx_t_4) {
      } else {
        __pyx_t_6 = __pyx_t_4;
        goto __pyx_L13_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_workset_get);
      __pyx_t_2 = __pyx_v_workset_get; __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_key);
        __Pyx_INCREF(__pyx_v_tidt);
        __Pyx_GIVEREF(__pyx_v_tidt);
        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_tidt);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_tid, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 471, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __pyx_t_4;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_6) {

        /* "chorde/clients/async.py":472
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event             # <<<<<<<<<<<<<<
 *                 if ev is not None:
 *                     done = ev.wait(1.0)
 */
        __Pyx_INCREF(__pyx_v_done_event);
        __Pyx_DECREF_SET(__pyx_v_ev, __pyx_v_done_event);

        /* "chorde/clients/async.py":471
 *                 if ev is not None:
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):             # <<<<<<<<<<<<<<
 *                     ev = done_event
 *                 if ev is not None:
 */
      }
      __pyx_L12:;

      /* "chorde/clients/async.py":473
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     done = ev.wait(1.0)
 *                     if not done:
 */
      __pyx_t_6 = (__pyx_v_ev != Py_None);
      __pyx_t_4 = (__pyx_t_6 != 0);
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":474
 *                     ev = done_event
 *                 if ev is not None:
 *                     done = ev.wait(1.0)             # <<<<<<<<<<<<<<
 *                     if not done:
 *                         busyloop = 0
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_wait); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_float_1_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_1_0);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_done, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "chorde/clients/async.py":475
 *                 if ev is not None:
 *                     done = ev.wait(1.0)
 *                     if not done:             # <<<<<<<<<<<<<<
 *                         busyloop = 0
 *                     else:
 */
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_done); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 475, __pyx_L1_error)
        __pyx_t_6 = ((!__pyx_t_4) != 0);
        if (__pyx_t_6) {

          /* "chorde/clients/async.py":476
 *                     done = ev.wait(1.0)
 *                     if not done:
 *                         busyloop = 0             # <<<<<<<<<<<<<<
 *                     else:
 *                         busyloop += 1
 */
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_DECREF_SET(__pyx_v_busyloop, __pyx_int_0);

          /* "chorde/clients/async.py":475
 *                 if ev is not None:
 *                     done = ev.wait(1.0)
 *                     if not done:             # <<<<<<<<<<<<<<
 *                         busyloop = 0
 *                     else:
 */
          goto __pyx_L16;
        }

        /* "chorde/clients/async.py":478
 *                         busyloop = 0
 *                     else:
 *                         busyloop += 1             # <<<<<<<<<<<<<<
 *                         if busyloop > 5:
 *                             if ev is done_event:
 */
        /*else*/ {
          __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_busyloop, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF_SET(__pyx_v_busyloop, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "chorde/clients/async.py":479
 *                     else:
 *                         busyloop += 1
 *                         if busyloop > 5:             # <<<<<<<<<<<<<<
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():
 */
          __pyx_t_1 = PyObject_RichCompare(__pyx_v_busyloop, __pyx_int_5, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error)
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_6) {

            /* "chorde/clients/async.py":480
 *                         busyloop += 1
 *                         if busyloop > 5:
 *                             if ev is done_event:             # <<<<<<<<<<<<<<
 *                                 if busyloop > 20 and ev.isSet():
 *                                     ev.clear()
 */
            __pyx_t_6 = (__pyx_v_ev == __pyx_v_done_event);
            __pyx_t_4 = (__pyx_t_6 != 0);
            if (__pyx_t_4) {

              /* "chorde/clients/async.py":481
 *                         if busyloop > 5:
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():             # <<<<<<<<<<<<<<
 *                                     ev.clear()
 *                             else:
 */
              __pyx_t_1 = PyObject_RichCompare(__pyx_v_busyloop, __pyx_int_20, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 481, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (__pyx_t_6) {
              } else {
                __pyx_t_4 = __pyx_t_6;
                goto __pyx_L20_bool_binop_done;
              }
              __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_isSet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_2, function);
                }
              }
              __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 481, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_4 = __pyx_t_6;
              __pyx_L20_bool_binop_done:;
              if (__pyx_t_4) {

                /* "chorde/clients/async.py":482
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():
 *                                     ev.clear()             # <<<<<<<<<<<<<<
 *                             else:
 *                                 sleep(0.05)
 */
                __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_3 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
                  if (likely(__pyx_t_3)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                    __Pyx_INCREF(__pyx_t_3);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_2, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                /* "chorde/clients/async.py":481
 *                         if busyloop > 5:
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():             # <<<<<<<<<<<<<<
 *                                     ev.clear()
 *                             else:
 */
              }

              /* "chorde/clients/async.py":480
 *                         busyloop += 1
 *                         if busyloop > 5:
 *                             if ev is done_event:             # <<<<<<<<<<<<<<
 *                                 if busyloop > 20 and ev.isSet():
 *                                     ev.clear()
 */
              goto __pyx_L18;
            }

            /* "chorde/clients/async.py":484
 *                                     ev.clear()
 *                             else:
 *                                 sleep(0.05)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
            /*else*/ {
              __Pyx_INCREF(__pyx_v_sleep);
              __pyx_t_2 = __pyx_v_sleep; __pyx_t_3 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_2, function);
                }
              }
              __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_float_0_05) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_0_05);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __pyx_L18:;

            /* "chorde/clients/async.py":479
 *                     else:
 *                         busyloop += 1
 *                         if busyloop > 5:             # <<<<<<<<<<<<<<
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():
 */
          }
        }
        __pyx_L16:;

        /* "chorde/clients/async.py":473
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     done = ev.wait(1.0)
 *                     if not done:
 */
        goto __pyx_L15;
      }

      /* "chorde/clients/async.py":486
 *                                 sleep(0.05)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 *         else:
 *             # contains inlined for speed in code below
 */
      /*else*/ {
        goto __pyx_L9_break;
      }
      __pyx_L15:;
    }
    __pyx_L9_break:;

    /* "chorde/clients/async.py":465
 *         busyloop = 0
 * 
 *         if timeout is None:             # <<<<<<<<<<<<<<
 *             # contains inlined for speed in code below
 *             while (key in queueset or workset_get(key, tidt)[0] != tid):
 */
    goto __pyx_L7;
  }

  /* "chorde/clients/async.py":489
 *         else:
 *             # contains inlined for speed in code below
 *             time_time = time.time             # <<<<<<<<<<<<<<
 *             tfin = time_time() + timeout
 *             while (key in queueset or workset_get(key, tidt)[0] != tid) and tfin >= time_time():
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_time_time = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "chorde/clients/async.py":490
 *             # contains inlined for speed in code below
 *             time_time = time.time
 *             tfin = time_time() + timeout             # <<<<<<<<<<<<<<
 *             while (key in queueset or workset_get(key, tidt)[0] != tid) and tfin >= time_time():
 *                 ev = workset_get(key)
 */
    __Pyx_INCREF(__pyx_v_time_time);
    __pyx_t_1 = __pyx_v_time_time; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_tfin = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":491
 *             time_time = time.time
 *             tfin = time_time() + timeout
 *             while (key in queueset or workset_get(key, tidt)[0] != tid) and tfin >= time_time():             # <<<<<<<<<<<<<<
 *                 ev = workset_get(key)
 *                 if ev is not None:
 */
    while (1) {
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_queueset, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (!__pyx_t_5) {
      } else {
        goto __pyx_L25_next_and;
      }
      __Pyx_INCREF(__pyx_v_workset_get);
      __pyx_t_2 = __pyx_v_workset_get; __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_key);
        __Pyx_INCREF(__pyx_v_tidt);
        __Pyx_GIVEREF(__pyx_v_tidt);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_tidt);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_tid, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_L25_next_and:;
      __Pyx_INCREF(__pyx_v_time_time);
      __pyx_t_2 = __pyx_v_time_time; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_tfin, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __pyx_t_5;
      __pyx_L24_bool_binop_done:;
      if (!__pyx_t_4) break;

      /* "chorde/clients/async.py":492
 *             tfin = time_time() + timeout
 *             while (key in queueset or workset_get(key, tidt)[0] != tid) and tfin >= time_time():
 *                 ev = workset_get(key)             # <<<<<<<<<<<<<<
 *                 if ev is not None:
 *                     ev = ev[2]
 */
      __Pyx_INCREF(__pyx_v_workset_get);
      __pyx_t_1 = __pyx_v_workset_get; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_key);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_ev, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "chorde/clients/async.py":493
 *             while (key in queueset or workset_get(key, tidt)[0] != tid) and tfin >= time_time():
 *                 ev = workset_get(key)
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 */
      __pyx_t_4 = (__pyx_v_ev != Py_None);
      __pyx_t_5 = (__pyx_t_4 != 0);
      if (__pyx_t_5) {

        /* "chorde/clients/async.py":494
 *                 ev = workset_get(key)
 *                 if ev is not None:
 *                     ev = ev[2]             # <<<<<<<<<<<<<<
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ev, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_ev, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "chorde/clients/async.py":493
 *             while (key in queueset or workset_get(key, tidt)[0] != tid) and tfin >= time_time():
 *                 ev = workset_get(key)
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 */
        goto __pyx_L27;
      }

      /* "chorde/clients/async.py":495
 *                 if ev is not None:
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):             # <<<<<<<<<<<<<<
 *                     ev = done_event
 *                 if ev is not None:
 */
      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_queueset, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_4 != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L28_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_workset_get);
      __pyx_t_1 = __pyx_v_workset_get; __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_key, __pyx_v_tidt};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_key);
        __Pyx_INCREF(__pyx_v_tidt);
        __Pyx_GIVEREF(__pyx_v_tidt);
        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_tidt);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_tid, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __pyx_t_6;
      __pyx_L28_bool_binop_done:;
      if (__pyx_t_5) {

        /* "chorde/clients/async.py":496
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event             # <<<<<<<<<<<<<<
 *                 if ev is not None:
 *                     done = ev.wait(min(1.0, timeout))
 */
        __Pyx_INCREF(__pyx_v_done_event);
        __Pyx_DECREF_SET(__pyx_v_ev, __pyx_v_done_event);

        /* "chorde/clients/async.py":495
 *                 if ev is not None:
 *                     ev = ev[2]
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):             # <<<<<<<<<<<<<<
 *                     ev = done_event
 *                 if ev is not None:
 */
      }
      __pyx_L27:;

      /* "chorde/clients/async.py":497
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     done = ev.wait(min(1.0, timeout))
 *                     if not done:
 */
      __pyx_t_5 = (__pyx_v_ev != Py_None);
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {

        /* "chorde/clients/async.py":498
 *                     ev = done_event
 *                 if ev is not None:
 *                     done = ev.wait(min(1.0, timeout))             # <<<<<<<<<<<<<<
 *                     if not done:
 *                         busyloop = 0
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_timeout);
        __pyx_t_3 = __pyx_v_timeout;
        __pyx_t_9 = 1.0;
        __pyx_t_10 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (__pyx_t_6) {
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_8 = __pyx_t_3;
        } else {
          __pyx_t_11 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 498, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_done, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "chorde/clients/async.py":499
 *                 if ev is not None:
 *                     done = ev.wait(min(1.0, timeout))
 *                     if not done:             # <<<<<<<<<<<<<<
 *                         busyloop = 0
 *                     else:
 */
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_done); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 499, __pyx_L1_error)
        __pyx_t_5 = ((!__pyx_t_6) != 0);
        if (__pyx_t_5) {

          /* "chorde/clients/async.py":500
 *                     done = ev.wait(min(1.0, timeout))
 *                     if not done:
 *                         busyloop = 0             # <<<<<<<<<<<<<<
 *                     else:
 *                         busyloop += 1
 */
          __Pyx_INCREF(__pyx_int_0);
          __Pyx_DECREF_SET(__pyx_v_busyloop, __pyx_int_0);

          /* "chorde/clients/async.py":499
 *                 if ev is not None:
 *                     done = ev.wait(min(1.0, timeout))
 *                     if not done:             # <<<<<<<<<<<<<<
 *                         busyloop = 0
 *                     else:
 */
          goto __pyx_L31;
        }

        /* "chorde/clients/async.py":502
 *                         busyloop = 0
 *                     else:
 *                         busyloop += 1             # <<<<<<<<<<<<<<
 *                         if busyloop > 5:
 *                             if ev is done_event:
 */
        /*else*/ {
          __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_busyloop, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF_SET(__pyx_v_busyloop, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "chorde/clients/async.py":503
 *                     else:
 *                         busyloop += 1
 *                         if busyloop > 5:             # <<<<<<<<<<<<<<
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():
 */
          __pyx_t_2 = PyObject_RichCompare(__pyx_v_busyloop, __pyx_int_5, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_5) {

            /* "chorde/clients/async.py":504
 *                         busyloop += 1
 *                         if busyloop > 5:
 *                             if ev is done_event:             # <<<<<<<<<<<<<<
 *                                 if busyloop > 20 and ev.isSet():
 *                                     ev.clear()
 */
            __pyx_t_5 = (__pyx_v_ev == __pyx_v_done_event);
            __pyx_t_6 = (__pyx_t_5 != 0);
            if (__pyx_t_6) {

              /* "chorde/clients/async.py":505
 *                         if busyloop > 5:
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():             # <<<<<<<<<<<<<<
 *                                     ev.clear()
 *                             else:
 */
              __pyx_t_2 = PyObject_RichCompare(__pyx_v_busyloop, __pyx_int_20, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
              __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_t_5) {
              } else {
                __pyx_t_6 = __pyx_t_5;
                goto __pyx_L35_bool_binop_done;
              }
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_isSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_8 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_8)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_8);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                }
              }
              __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_6 = __pyx_t_5;
              __pyx_L35_bool_binop_done:;
              if (__pyx_t_6) {

                /* "chorde/clients/async.py":506
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():
 *                                     ev.clear()             # <<<<<<<<<<<<<<
 *                             else:
 *                                 sleep(0.05)
 */
                __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ev, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_8 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
                  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
                  if (likely(__pyx_t_8)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                    __Pyx_INCREF(__pyx_t_8);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_1, function);
                  }
                }
                __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                /* "chorde/clients/async.py":505
 *                         if busyloop > 5:
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():             # <<<<<<<<<<<<<<
 *                                     ev.clear()
 *                             else:
 */
              }

              /* "chorde/clients/async.py":504
 *                         busyloop += 1
 *                         if busyloop > 5:
 *                             if ev is done_event:             # <<<<<<<<<<<<<<
 *                                 if busyloop > 20 and ev.isSet():
 *                                     ev.clear()
 */
              goto __pyx_L33;
            }

            /* "chorde/clients/async.py":508
 *                                     ev.clear()
 *                             else:
 *                                 sleep(0.05)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
            /*else*/ {
              __Pyx_INCREF(__pyx_v_sleep);
              __pyx_t_1 = __pyx_v_sleep; __pyx_t_8 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_8)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_8);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                }
              }
              __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_float_0_05) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_float_0_05);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __pyx_L33:;

            /* "chorde/clients/async.py":503
 *                     else:
 *                         busyloop += 1
 *                         if busyloop > 5:             # <<<<<<<<<<<<<<
 *                             if ev is done_event:
 *                                 if busyloop > 20 and ev.isSet():
 */
          }
        }
        __pyx_L31:;

        /* "chorde/clients/async.py":497
 *                 elif (key in queueset or workset_get(key, tidt)[0] != tid):
 *                     ev = done_event
 *                 if ev is not None:             # <<<<<<<<<<<<<<
 *                     done = ev.wait(min(1.0, timeout))
 *                     if not done:
 */
        goto __pyx_L30;
      }

      /* "chorde/clients/async.py":510
 *                                 sleep(0.05)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 *                 timeout = tfin - time_time()
 * 
 */
      /*else*/ {
        goto __pyx_L23_break;
      }
      __pyx_L30:;

      /* "chorde/clients/async.py":511
 *                 else:
 *                     break
 *                 timeout = tfin - time_time()             # <<<<<<<<<<<<<<
 * 
 *     def getTtl(self, key, default = None):
 */
      __Pyx_INCREF(__pyx_v_time_time);
      __pyx_t_1 = __pyx_v_time_time; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Subtract(__pyx_v_tfin, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L23_break:;
  }
  __pyx_L7:;

  /* "chorde/clients/async.py":451
 *         return delayed
 * 
 *     def waitkey(self, key, timeout=None):             # <<<<<<<<<<<<<<
 *         tid = thread.get_ident()
 *         if (tid in self.threadset
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.waitkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tid);
  __Pyx_XDECREF(__pyx_v_tidt);
  __Pyx_XDECREF(__pyx_v_queueset);
  __Pyx_XDECREF(__pyx_v_workset_get);
  __Pyx_XDECREF(__pyx_v_done_event);
  __Pyx_XDECREF(__pyx_v_sleep);
  __Pyx_XDECREF(__pyx_v_busyloop);
  __Pyx_XDECREF(__pyx_v_ev);
  __Pyx_XDECREF(__pyx_v_done);
  __Pyx_XDECREF(__pyx_v_time_time);
  __Pyx_XDECREF(__pyx_v_tfin);
  __Pyx_XDECREF(__pyx_v_timeout);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":513
 *                 timeout = tfin - time_time()
 * 
 *     def getTtl(self, key, default = None):             # <<<<<<<<<<<<<<
 *         # Speeding up things - we have the same signature and semantics
 *         self.getTtl = getTtl = self.queueset.get
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_27getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_27getTtl = {"getTtl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_27getTtl, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_27getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTtl (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 3, 1); __PYX_ERR(0, 513, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getTtl") < 0)) __PYX_ERR(0, 513, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 513, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_26getTtl(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_26getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
  PyObject *__pyx_v_getTtl = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTtl", 0);

  /* "chorde/clients/async.py":515
 *     def getTtl(self, key, default = None):
 *         # Speeding up things - we have the same signature and semantics
 *         self.getTtl = getTtl = self.queueset.get             # <<<<<<<<<<<<<<
 *         return getTtl(key, default)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_getTtl, __pyx_t_2) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_getTtl = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":516
 *         # Speeding up things - we have the same signature and semantics
 *         self.getTtl = getTtl = self.queueset.get
 *         return getTtl(key, default)             # <<<<<<<<<<<<<<
 * 
 *     def contains(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_getTtl);
  __pyx_t_1 = __pyx_v_getTtl; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_default};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_default};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_default);
    __Pyx_GIVEREF(__pyx_v_default);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_default);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":513
 *                 timeout = tfin - time_time()
 * 
 *     def getTtl(self, key, default = None):             # <<<<<<<<<<<<<<
 *         # Speeding up things - we have the same signature and semantics
 *         self.getTtl = getTtl = self.queueset.get
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_getTtl);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":518
 *         return getTtl(key, default)
 * 
 *     def contains(self, key):             # <<<<<<<<<<<<<<
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_29contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_29contains = {"contains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_29contains, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_29contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contains (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("contains", 1, 2, 2, 1); __PYX_ERR(0, 518, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contains") < 0)) __PYX_ERR(0, 518, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_28contains(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_28contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_tid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contains", 0);

  /* "chorde/clients/async.py":520
 *     def contains(self, key):
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":521
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             # Exclude keys being computed by this thread, such calls
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "chorde/clients/async.py":520
 *     def contains(self, key):
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  }

  /* "chorde/clients/async.py":525
 *             # Exclude keys being computed by this thread, such calls
 *             # want the async wrapper out of their way
 *             tid = thread.get_ident()             # <<<<<<<<<<<<<<
 *             return self.workset.get(key, (tid,))[0] != tid
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_thread); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_ident); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_tid = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":526
 *             # want the async wrapper out of their way
 *             tid = thread.get_ident()
 *             return self.workset.get(key, (tid,))[0] != tid             # <<<<<<<<<<<<<<
 * 
 *     def _contains(self, key):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_tid);
    __Pyx_GIVEREF(__pyx_v_tid);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tid);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_key, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_key, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_tid, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":518
 *         return getTtl(key, default)
 * 
 *     def contains(self, key):             # <<<<<<<<<<<<<<
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":528
 *             return self.workset.get(key, (tid,))[0] != tid
 * 
 *     def _contains(self, key):             # <<<<<<<<<<<<<<
 *         # Fast version of contains that doesn't check the workset
 *         # Useful for special-purpose checks, like contains(CLEAR)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_31_contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_31_contains = {"_contains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_31_contains, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_31_contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_contains (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 528, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_contains") < 0)) __PYX_ERR(0, 528, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 528, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_30_contains(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_30_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v__contains = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_contains", 0);

  /* "chorde/clients/async.py":531
 *         # Fast version of contains that doesn't check the workset
 *         # Useful for special-purpose checks, like contains(CLEAR)
 *         self._contains = _contains = self.queueset.__contains__             # <<<<<<<<<<<<<<
 *         return _contains(key)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_contains_2, __pyx_t_2) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v__contains = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":532
 *         # Useful for special-purpose checks, like contains(CLEAR)
 *         self._contains = _contains = self.queueset.__contains__
 *         return _contains(key)             # <<<<<<<<<<<<<<
 * 
 *     def put(self, key, value, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v__contains);
  __pyx_t_1 = __pyx_v__contains; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":528
 *             return self.workset.get(key, (tid,))[0] != tid
 * 
 *     def _contains(self, key):             # <<<<<<<<<<<<<<
 *         # Fast version of contains that doesn't check the workset
 *         # Useful for special-purpose checks, like contains(CLEAR)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool._contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__contains);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":534
 *         return _contains(key)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, value, ttl, **kw)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_33put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_33put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_33put, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_33put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 1); __PYX_ERR(0, 534, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 2); __PYX_ERR(0, 534, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 3); __PYX_ERR(0, 534, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "put") < 0)) __PYX_ERR(0, 534, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 534, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_32put(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_32put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);

  /* "chorde/clients/async.py":535
 * 
 *     def put(self, key, value, ttl, **kw):
 *         self.enqueue(key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def renew(self, key, ttl, **kw):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ttl);
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":534
 *         return _contains(key)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, value, ttl, **kw)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":537
 *         self.enqueue(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         # Don't schedule a renew if another thing is queued on the key
 *         # It causes... issues
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_35renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_35renew = {"renew", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_35renew, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_35renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renew (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ttl,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 1); __PYX_ERR(0, 537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 2); __PYX_ERR(0, 537, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "renew") < 0)) __PYX_ERR(0, 537, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_ttl = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 537, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_34renew(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_34renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renew", 0);

  /* "chorde/clients/async.py":540
 *         # Don't schedule a renew if another thing is queued on the key
 *         # It causes... issues
 *         if key not in self.queueset and key not in self.workset:             # <<<<<<<<<<<<<<
 *             self.enqueue(key, _RENEW, ttl, **kw)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queueset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":541
 *         # It causes... issues
 *         if key not in self.queueset and key not in self.workset:
 *             self.enqueue(key, _RENEW, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, key):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ttl);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "chorde/clients/async.py":540
 *         # Don't schedule a renew if another thing is queued on the key
 *         # It causes... issues
 *         if key not in self.queueset and key not in self.workset:             # <<<<<<<<<<<<<<
 *             self.enqueue(key, _RENEW, ttl, **kw)
 * 
 */
  }

  /* "chorde/clients/async.py":537
 *         self.enqueue(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         # Don't schedule a renew if another thing is queued on the key
 *         # It causes... issues
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":543
 *             self.enqueue(key, _RENEW, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _DELETE)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_37delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_37delete = {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_37delete, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_37delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, 1); __PYX_ERR(0, 543, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(0, 543, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 543, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_36delete(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_36delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "chorde/clients/async.py":544
 * 
 *     def delete(self, key):
 *         self.enqueue(key, _DELETE)             # <<<<<<<<<<<<<<
 * 
 *     def expire(self, key):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":543
 *             self.enqueue(key, _RENEW, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _DELETE)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":546
 *         self.enqueue(key, _DELETE)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _EXPIRE)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_39expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_39expire = {"expire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_39expire, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_39expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expire (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, 1); __PYX_ERR(0, 546, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "expire") < 0)) __PYX_ERR(0, 546, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 546, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_38expire(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_38expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expire", 0);

  /* "chorde/clients/async.py":547
 * 
 *     def expire(self, key):
 *         self.enqueue(key, _EXPIRE)             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":546
 *         self.enqueue(key, _DELETE)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _EXPIRE)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":549
 *         self.enqueue(key, _EXPIRE)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_41clear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_41clear = {"clear", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_41clear, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_41clear(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_40clear(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_40clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_delayed = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 0);

  /* "chorde/clients/async.py":550
 * 
 *     def clear(self):
 *         delayed = self.clearqueue()             # <<<<<<<<<<<<<<
 *         self.enqueue(_CLEAR, _CLEAR)
 *         for delayed in delayed:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clearqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_delayed = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":551
 *     def clear(self):
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)             # <<<<<<<<<<<<<<
 *         for delayed in delayed:
 *             try:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":552
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)
 *         for delayed in delayed:             # <<<<<<<<<<<<<<
 *             try:
 *                 delayed()
 */
  if (likely(PyList_CheckExact(__pyx_v_delayed)) || PyTuple_CheckExact(__pyx_v_delayed)) {
    __pyx_t_1 = __pyx_v_delayed; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_delayed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 552, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 552, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 552, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 552, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_delayed, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "chorde/clients/async.py":553
 *         self.enqueue(_CLEAR, _CLEAR)
 *         for delayed in delayed:
 *             try:             # <<<<<<<<<<<<<<
 *                 delayed()
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "chorde/clients/async.py":554
 *         for delayed in delayed:
 *             try:
 *                 delayed()             # <<<<<<<<<<<<<<
 *             except:
 *                 pass
 */
        __Pyx_INCREF(__pyx_v_delayed);
        __pyx_t_7 = __pyx_v_delayed; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "chorde/clients/async.py":553
 *         self.enqueue(_CLEAR, _CLEAR)
 *         for delayed in delayed:
 *             try:             # <<<<<<<<<<<<<<
 *                 delayed()
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "chorde/clients/async.py":555
 *             try:
 *                 delayed()
 *             except:             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
      /*except:*/ {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L12_try_end:;
    }

    /* "chorde/clients/async.py":552
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)
 *         for delayed in delayed:             # <<<<<<<<<<<<<<
 *             try:
 *                 delayed()
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":549
 *         self.enqueue(key, _EXPIRE)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delayed);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":558
 *                 pass
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         self.enqueue(_PURGE, _PURGE)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_43purge(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_43purge = {"purge", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_43purge, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_43purge(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("purge (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_42purge(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_42purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("purge", 0);

  /* "chorde/clients/async.py":559
 * 
 *     def purge(self):
 *         self.enqueue(_PURGE, _PURGE)             # <<<<<<<<<<<<<<
 * 
 *     def register_cleanup(self, task):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PURGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PURGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":558
 *                 pass
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         self.enqueue(_PURGE, _PURGE)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":561
 *         self.enqueue(_PURGE, _PURGE)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_45register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_20AsyncCacheWriterPool_44register_cleanup[] = "\n        Register a callable that will take no arguments, and will\n        be invoked every cleanup_cycles tasks in order to perform\n        thread-local cleanup for this writer.\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_45register_cleanup = {"register_cleanup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_45register_cleanup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_20AsyncCacheWriterPool_44register_cleanup};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_45register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_task = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_cleanup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_task,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_task)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, 1); __PYX_ERR(0, 561, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_cleanup") < 0)) __PYX_ERR(0, 561, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_task = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_44register_cleanup(__pyx_self, __pyx_v_self, __pyx_v_task);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_44register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_cleanup", 0);

  /* "chorde/clients/async.py":567
 *         thread-local cleanup for this writer.
 *         """
 *         self.cleanup_tasks.append(task)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_task); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":561
 *         self.enqueue(_PURGE, _PURGE)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":570
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_47register_default_cleanup(PyObject *__pyx_self, PyObject *__pyx_v_task); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_20AsyncCacheWriterPool_46register_default_cleanup[] = "\n        Register a callable that will take no arguments, and will\n        be invoked every cleanup_cycles tasks in order to perform\n        thread-local cleanup for all async processors (including\n        async writers and async processors both).\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_47register_default_cleanup = {"register_default_cleanup", (PyCFunction)__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_47register_default_cleanup, METH_O, __pyx_doc_6chorde_7clients_5async_20AsyncCacheWriterPool_46register_default_cleanup};
static PyObject *__pyx_pw_6chorde_7clients_5async_20AsyncCacheWriterPool_47register_default_cleanup(PyObject *__pyx_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_default_cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_46register_default_cleanup(__pyx_self, ((PyObject *)__pyx_v_task));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_20AsyncCacheWriterPool_46register_default_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_default_cleanup", 0);

  /* "chorde/clients/async.py":577
 *         async writers and async processors both).
 *         """
 *         _global_cleanup_tasks.append(task)             # <<<<<<<<<<<<<<
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_global_cleanup_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_task); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":570
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheWriterPool.register_default_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":580
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_writer_queue_size = 0;
  PyObject *__pyx_v_writer_workers = 0;
  PyObject *__pyx_v_overflow = 0;
  PyObject *__pyx_v_threadpool = 0;
  PyObject *__pyx_v_defer_threadpool = 0;
  PyObject *__pyx_v_writer_threadpool = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,&__pyx_n_s_writer_queue_size,&__pyx_n_s_writer_workers,&__pyx_n_s_overflow,&__pyx_n_s_threadpool,&__pyx_n_s_defer_threadpool,&__pyx_n_s_writer_threadpool,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)Py_None));

    /* "chorde/clients/async.py":581
 * class AsyncWriteCacheClient(BaseCacheClient):
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,
 *             defer_threadpool = None, writer_threadpool = None):             # <<<<<<<<<<<<<<
 *         self.client = client
 *         self.writer_queue_size = writer_queue_size
 */
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, 1); __PYX_ERR(0, 580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_queue_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, 2); __PYX_ERR(0, 580, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_workers);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overflow);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threadpool);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defer_threadpool);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_threadpool);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 580, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_client = values[1];
    __pyx_v_writer_queue_size = values[2];
    __pyx_v_writer_workers = values[3];
    __pyx_v_overflow = values[4];
    __pyx_v_threadpool = values[5];
    __pyx_v_defer_threadpool = values[6];
    __pyx_v_writer_threadpool = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 580, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient___init__(__pyx_self, __pyx_v_self, __pyx_v_client, __pyx_v_writer_queue_size, __pyx_v_writer_workers, __pyx_v_overflow, __pyx_v_threadpool, __pyx_v_defer_threadpool, __pyx_v_writer_threadpool);

  /* "chorde/clients/async.py":580
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_writer_queue_size, PyObject *__pyx_v_writer_workers, PyObject *__pyx_v_overflow, PyObject *__pyx_v_threadpool, PyObject *__pyx_v_defer_threadpool, PyObject *__pyx_v_writer_threadpool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":582
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.writer_queue_size = writer_queue_size
 *         self.writer_workers = writer_workers if writer_workers is not None else multiprocessing.cpu_count()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 582, __pyx_L1_error)

  /* "chorde/clients/async.py":583
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client
 *         self.writer_queue_size = writer_queue_size             # <<<<<<<<<<<<<<
 *         self.writer_workers = writer_workers if writer_workers is not None else multiprocessing.cpu_count()
 *         self.writer = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_queue_size, __pyx_v_writer_queue_size) < 0) __PYX_ERR(0, 583, __pyx_L1_error)

  /* "chorde/clients/async.py":584
 *         self.client = client
 *         self.writer_queue_size = writer_queue_size
 *         self.writer_workers = writer_workers if writer_workers is not None else multiprocessing.cpu_count()             # <<<<<<<<<<<<<<
 *         self.writer = None
 *         self.overflow = overflow
 */
  __pyx_t_2 = (__pyx_v_writer_workers != Py_None);
  if ((__pyx_t_2 != 0)) {
    __Pyx_INCREF(__pyx_v_writer_workers);
    __pyx_t_1 = __pyx_v_writer_workers;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_workers, __pyx_t_1) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":585
 *         self.writer_queue_size = writer_queue_size
 *         self.writer_workers = writer_workers if writer_workers is not None else multiprocessing.cpu_count()
 *         self.writer = None             # <<<<<<<<<<<<<<
 *         self.overflow = overflow
 *         self.spawning_lock = threading.Lock()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_2, Py_None) < 0) __PYX_ERR(0, 585, __pyx_L1_error)

  /* "chorde/clients/async.py":586
 *         self.writer_workers = writer_workers if writer_workers is not None else multiprocessing.cpu_count()
 *         self.writer = None
 *         self.overflow = overflow             # <<<<<<<<<<<<<<
 *         self.spawning_lock = threading.Lock()
 *         self._defer_threadpool = defer_threadpool or threadpool
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_overflow, __pyx_v_overflow) < 0) __PYX_ERR(0, 586, __pyx_L1_error)

  /* "chorde/clients/async.py":587
 *         self.writer = None
 *         self.overflow = overflow
 *         self.spawning_lock = threading.Lock()             # <<<<<<<<<<<<<<
 *         self._defer_threadpool = defer_threadpool or threadpool
 *         self._writer_threadpool = writer_threadpool or threadpool
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spawning_lock, __pyx_t_1) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":588
 *         self.overflow = overflow
 *         self.spawning_lock = threading.Lock()
 *         self._defer_threadpool = defer_threadpool or threadpool             # <<<<<<<<<<<<<<
 *         self._writer_threadpool = writer_threadpool or threadpool
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_defer_threadpool); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 588, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_defer_threadpool);
    __pyx_t_1 = __pyx_v_defer_threadpool;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_threadpool);
  __pyx_t_1 = __pyx_v_threadpool;
  __pyx_L3_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":589
 *         self.spawning_lock = threading.Lock()
 *         self._defer_threadpool = defer_threadpool or threadpool
 *         self._writer_threadpool = writer_threadpool or threadpool             # <<<<<<<<<<<<<<
 * 
 *     def assert_started(self):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_writer_threadpool); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 589, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_writer_threadpool);
    __pyx_t_1 = __pyx_v_writer_threadpool;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_threadpool);
  __pyx_t_1 = __pyx_v_threadpool;
  __pyx_L5_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":580
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":591
 *         self._writer_threadpool = writer_threadpool or threadpool
 * 
 *     def assert_started(self):             # <<<<<<<<<<<<<<
 *         if self.writer is None:
 *             with self.spawning_lock:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_3assert_started(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_3assert_started = {"assert_started", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_3assert_started, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_3assert_started(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_started (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_2assert_started(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_2assert_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assert_started", 0);

  /* "chorde/clients/async.py":592
 * 
 *     def assert_started(self):
 *         if self.writer is None:             # <<<<<<<<<<<<<<
 *             with self.spawning_lock:
 *                 if self.writer is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":593
 *     def assert_started(self):
 *         if self.writer is None:
 *             with self.spawning_lock:             # <<<<<<<<<<<<<<
 *                 if self.writer is None:
 *                     self.writer = AsyncCacheWriterPool(
 */
    /*with:*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spawning_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {

            /* "chorde/clients/async.py":594
 *         if self.writer is None:
 *             with self.spawning_lock:
 *                 if self.writer is None:             # <<<<<<<<<<<<<<
 *                     self.writer = AsyncCacheWriterPool(
 *                         self.writer_queue_size,
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = (__pyx_t_1 == Py_None);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {

              /* "chorde/clients/async.py":595
 *             with self.spawning_lock:
 *                 if self.writer is None:
 *                     self.writer = AsyncCacheWriterPool(             # <<<<<<<<<<<<<<
 *                         self.writer_queue_size,
 *                         self.writer_workers,
 */
              __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncCacheWriterPool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_1);

              /* "chorde/clients/async.py":596
 *                 if self.writer is None:
 *                     self.writer = AsyncCacheWriterPool(
 *                         self.writer_queue_size,             # <<<<<<<<<<<<<<
 *                         self.writer_workers,
 *                         self.client,
 */
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_queue_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_5);

              /* "chorde/clients/async.py":597
 *                     self.writer = AsyncCacheWriterPool(
 *                         self.writer_queue_size,
 *                         self.writer_workers,             # <<<<<<<<<<<<<<
 *                         self.client,
 *                         self.overflow,
 */
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_6);

              /* "chorde/clients/async.py":598
 *                         self.writer_queue_size,
 *                         self.writer_workers,
 *                         self.client,             # <<<<<<<<<<<<<<
 *                         self.overflow,
 *                         defer_threadpool = self._defer_threadpool,
 */
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_7);

              /* "chorde/clients/async.py":599
 *                         self.writer_workers,
 *                         self.client,
 *                         self.overflow,             # <<<<<<<<<<<<<<
 *                         defer_threadpool = self._defer_threadpool,
 *                         writer_threadpool = self._writer_threadpool)
 */
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_overflow); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 599, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_11);

              /* "chorde/clients/async.py":595
 *             with self.spawning_lock:
 *                 if self.writer is None:
 *                     self.writer = AsyncCacheWriterPool(             # <<<<<<<<<<<<<<
 *                         self.writer_queue_size,
 *                         self.writer_workers,
 */
              __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 595, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6);
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11);
              __pyx_t_5 = 0;
              __pyx_t_6 = 0;
              __pyx_t_7 = 0;
              __pyx_t_11 = 0;

              /* "chorde/clients/async.py":600
 *                         self.client,
 *                         self.overflow,
 *                         defer_threadpool = self._defer_threadpool,             # <<<<<<<<<<<<<<
 *                         writer_threadpool = self._writer_threadpool)
 * 
 */
              __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 600, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_defer_threadpool_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_defer_threadpool, __pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "chorde/clients/async.py":601
 *                         self.overflow,
 *                         defer_threadpool = self._defer_threadpool,
 *                         writer_threadpool = self._writer_threadpool)             # <<<<<<<<<<<<<<
 * 
 *     def is_started(self):
 */
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_threadpool_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_7);
              if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_writer_threadpool, __pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "chorde/clients/async.py":595
 *             with self.spawning_lock:
 *                 if self.writer is None:
 *                     self.writer = AsyncCacheWriterPool(             # <<<<<<<<<<<<<<
 *                         self.writer_queue_size,
 *                         self.writer_workers,
 */
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_2, __pyx_t_7) < 0) __PYX_ERR(0, 595, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "chorde/clients/async.py":594
 *         if self.writer is None:
 *             with self.spawning_lock:
 *                 if self.writer is None:             # <<<<<<<<<<<<<<
 *                     self.writer = AsyncCacheWriterPool(
 *                         self.writer_queue_size,
 */
            }

            /* "chorde/clients/async.py":593
 *     def assert_started(self):
 *         if self.writer is None:
 *             with self.spawning_lock:             # <<<<<<<<<<<<<<
 *                 if self.writer is None:
 *                     self.writer = AsyncCacheWriterPool(
 */
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.assert_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 593, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_1 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 593, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (__pyx_t_2 < 0) __PYX_ERR(0, 593, __pyx_L10_except_error)
            __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
            if (__pyx_t_3) {
              __Pyx_GIVEREF(__pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_11, __pyx_t_12);
              __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; 
              __PYX_ERR(0, 593, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 593, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L18;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L18:;
    }

    /* "chorde/clients/async.py":592
 * 
 *     def assert_started(self):
 *         if self.writer is None:             # <<<<<<<<<<<<<<
 *             with self.spawning_lock:
 *                 if self.writer is None:
 */
  }

  /* "chorde/clients/async.py":591
 *         self._writer_threadpool = writer_threadpool or threadpool
 * 
 *     def assert_started(self):             # <<<<<<<<<<<<<<
 *         if self.writer is None:
 *             with self.spawning_lock:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.assert_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":603
 *                         writer_threadpool = self._writer_threadpool)
 * 
 *     def is_started(self):             # <<<<<<<<<<<<<<
 *         return self.writer is not None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_5is_started(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_5is_started = {"is_started", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_5is_started, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_5is_started(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_started (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_4is_started(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_4is_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_started", 0);

  /* "chorde/clients/async.py":604
 * 
 *     def is_started(self):
 *         return self.writer is not None             # <<<<<<<<<<<<<<
 * 
 *     def start(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":603
 *                         writer_threadpool = self._writer_threadpool)
 * 
 *     def is_started(self):             # <<<<<<<<<<<<<<
 *         return self.writer is not None
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.is_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":606
 *         return self.writer is not None
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_7start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_7start = {"start", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_7start, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_7start(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_6start(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_6start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

  /* "chorde/clients/async.py":607
 * 
 *     def start(self):
 *         if self.writer is not None:             # <<<<<<<<<<<<<<
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 *         self.assert_started()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "chorde/clients/async.py":608
 *     def start(self):
 *         if self.writer is not None:
 *             raise AssertionError, "Starting AsyncCacheClient twice"             # <<<<<<<<<<<<<<
 *         self.assert_started()
 * 
 */
    __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_Starting_AsyncCacheClient_twice, 0, 0);
    __PYX_ERR(0, 608, __pyx_L1_error)

    /* "chorde/clients/async.py":607
 * 
 *     def start(self):
 *         if self.writer is not None:             # <<<<<<<<<<<<<<
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 *         self.assert_started()
 */
  }

  /* "chorde/clients/async.py":609
 *         if self.writer is not None:
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 *         self.assert_started()             # <<<<<<<<<<<<<<
 * 
 *     def stop(self, abort_tasks=False):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_started); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":606
 *         return self.writer is not None
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":611
 *         self.assert_started()
 * 
 *     def stop(self, abort_tasks=False):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             if not abort_tasks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_9stop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_9stop = {"stop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_9stop, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_9stop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_abort_tasks = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_abort_tasks,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_abort_tasks);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stop") < 0)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_abort_tasks = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stop", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 611, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_8stop(__pyx_self, __pyx_v_self, __pyx_v_abort_tasks);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_8stop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_abort_tasks) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stop", 0);

  /* "chorde/clients/async.py":612
 * 
 *     def stop(self, abort_tasks=False):
 *         if self.writer is not None:             # <<<<<<<<<<<<<<
 *             if not abort_tasks:
 *                 self.writer.join()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":613
 *     def stop(self, abort_tasks=False):
 *         if self.writer is not None:
 *             if not abort_tasks:             # <<<<<<<<<<<<<<
 *                 self.writer.join()
 *             self.writer.terminate()
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_abort_tasks); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 613, __pyx_L1_error)
    __pyx_t_2 = ((!__pyx_t_3) != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":614
 *         if self.writer is not None:
 *             if not abort_tasks:
 *                 self.writer.join()             # <<<<<<<<<<<<<<
 *             self.writer.terminate()
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":613
 *     def stop(self, abort_tasks=False):
 *         if self.writer is not None:
 *             if not abort_tasks:             # <<<<<<<<<<<<<<
 *                 self.writer.join()
 *             self.writer.terminate()
 */
    }

    /* "chorde/clients/async.py":615
 *             if not abort_tasks:
 *                 self.writer.join()
 *             self.writer.terminate()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_terminate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":612
 * 
 *     def stop(self, abort_tasks=False):
 *         if self.writer is not None:             # <<<<<<<<<<<<<<
 *             if not abort_tasks:
 *                 self.writer.join()
 */
  }

  /* "chorde/clients/async.py":611
 *         self.assert_started()
 * 
 *     def stop(self, abort_tasks=False):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             if not abort_tasks:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":618
 * 
 *     @property
 *     def async(self):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_11async(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_11async = {"async", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_11async, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_11async(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("async (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_10async(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_10async(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("async", 0);

  /* "chorde/clients/async.py":619
 *     @property
 *     def async(self):
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "chorde/clients/async.py":618
 * 
 *     @property
 *     def async(self):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":622
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_13capacity(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_13capacity = {"capacity", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_13capacity, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_13capacity(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_12capacity(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_12capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("capacity", 0);

  /* "chorde/clients/async.py":623
 *     @property
 *     def capacity(self):
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((__pyx_t_4 != 0)) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_capacity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
  }
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":622
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":626
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_15usage(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_15usage = {"usage", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_15usage, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_15usage(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("usage (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_14usage(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_14usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("usage", 0);

  /* "chorde/clients/async.py":627
 *     @property
 *     def usage(self):
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)             # <<<<<<<<<<<<<<
 * 
 *     def put(self, key, value, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_usage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((__pyx_t_4 != 0)) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_usage); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
  }
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":626
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.usage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":629
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.put(key, value, ttl, **kw)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_17put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_17put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_17put, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_17put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 1); __PYX_ERR(0, 629, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 2); __PYX_ERR(0, 629, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 3); __PYX_ERR(0, 629, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "put") < 0)) __PYX_ERR(0, 629, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 629, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_16put(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_16put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);

  /* "chorde/clients/async.py":630
 * 
 *     def put(self, key, value, ttl, **kw):
 *         self.assert_started()             # <<<<<<<<<<<<<<
 *         self.writer.put(key, value, ttl, **kw)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":631
 *     def put(self, key, value, ttl, **kw):
 *         self.assert_started()
 *         self.writer.put(key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def renew(self, key, ttl, **kw):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_ttl);
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":629
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.put(key, value, ttl, **kw)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":633
 *         self.writer.put(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.renew(key, ttl, **kw)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_19renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_19renew = {"renew", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_19renew, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_19renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renew (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ttl,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 1); __PYX_ERR(0, 633, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 2); __PYX_ERR(0, 633, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "renew") < 0)) __PYX_ERR(0, 633, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_ttl = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 633, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_18renew(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_18renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renew", 0);

  /* "chorde/clients/async.py":634
 * 
 *     def renew(self, key, ttl, **kw):
 *         self.assert_started()             # <<<<<<<<<<<<<<
 *         self.writer.renew(key, ttl, **kw)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":635
 *     def renew(self, key, ttl, **kw):
 *         self.assert_started()
 *         self.writer.renew(key, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, key):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_renew); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ttl);
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":633
 *         self.writer.put(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.renew(key, ttl, **kw)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":637
 *         self.writer.renew(key, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.delete(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_21delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_21delete = {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_21delete, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_21delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, 1); __PYX_ERR(0, 637, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(0, 637, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 637, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_20delete(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_20delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "chorde/clients/async.py":638
 * 
 *     def delete(self, key):
 *         self.assert_started()             # <<<<<<<<<<<<<<
 *         self.writer.delete(key)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":639
 *     def delete(self, key):
 *         self.assert_started()
 *         self.writer.delete(key)             # <<<<<<<<<<<<<<
 * 
 *     def expire(self, key):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_delete); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":637
 *         self.writer.renew(key, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.delete(key)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":641
 *         self.writer.delete(key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.expire(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_23expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_23expire = {"expire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_23expire, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_23expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expire (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, 1); __PYX_ERR(0, 641, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "expire") < 0)) __PYX_ERR(0, 641, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 641, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_22expire(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_22expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expire", 0);

  /* "chorde/clients/async.py":642
 * 
 *     def expire(self, key):
 *         self.assert_started()             # <<<<<<<<<<<<<<
 *         self.writer.expire(key)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":643
 *     def expire(self, key):
 *         self.assert_started()
 *         self.writer.expire(key)             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_expire); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":641
 *         self.writer.delete(key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.expire(key)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":645
 *         self.writer.expire(key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             self.writer.clear()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_25clear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_25clear = {"clear", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_25clear, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_25clear(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_24clear(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_24clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 0);

  /* "chorde/clients/async.py":646
 * 
 *     def clear(self):
 *         if self.is_started():             # <<<<<<<<<<<<<<
 *             self.writer.clear()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "chorde/clients/async.py":647
 *     def clear(self):
 *         if self.is_started():
 *             self.writer.clear()             # <<<<<<<<<<<<<<
 * 
 *     def purge(self, timeout = None):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":646
 * 
 *     def clear(self):
 *         if self.is_started():             # <<<<<<<<<<<<<<
 *             self.writer.clear()
 * 
 */
  }

  /* "chorde/clients/async.py":645
 *         self.writer.expire(key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             self.writer.clear()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":649
 *             self.writer.clear()
 * 
 *     def purge(self, timeout = None):             # <<<<<<<<<<<<<<
 *         """
 *         Timeout is ignored
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_27purge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_21AsyncWriteCacheClient_26purge[] = "\n        Timeout is ignored\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_27purge = {"purge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_27purge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_21AsyncWriteCacheClient_26purge};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_27purge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("purge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_timeout,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "purge") < 0)) __PYX_ERR(0, 649, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_timeout = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("purge", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 649, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_26purge(__pyx_self, __pyx_v_self, __pyx_v_timeout);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_26purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("purge", 0);

  /* "chorde/clients/async.py":653
 *         Timeout is ignored
 *         """
 *         if self.is_started():             # <<<<<<<<<<<<<<
 *             self.writer.purge()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "chorde/clients/async.py":654
 *         """
 *         if self.is_started():
 *             self.writer.purge()             # <<<<<<<<<<<<<<
 * 
 *     def getTtl(self, key, default = NONE,
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_purge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":653
 *         Timeout is ignored
 *         """
 *         if self.is_started():             # <<<<<<<<<<<<<<
 *             self.writer.purge()
 * 
 */
  }

  /* "chorde/clients/async.py":649
 *             self.writer.clear()
 * 
 *     def purge(self, timeout = None):             # <<<<<<<<<<<<<<
 *         """
 *         Timeout is ignored
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":656
 *             self.writer.purge()
 * 
 *     def getTtl(self, key, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_default);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__DELETE);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__EXPIRE);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__RENEW);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__CLEAR);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_hasattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_29getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_29getTtl = {"getTtl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_29getTtl, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_29getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v__DELETE = 0;
  PyObject *__pyx_v__EXPIRE = 0;
  PyObject *__pyx_v__RENEW = 0;
  PyObject *__pyx_v__CLEAR = 0;
  PyObject *__pyx_v_NONE = 0;
  PyObject *__pyx_v__NONE = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTtl (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,&__pyx_n_s_DELETE,&__pyx_n_s_EXPIRE,&__pyx_n_s_RENEW,&__pyx_n_s_CLEAR,&__pyx_n_s_NONE_2,&__pyx_n_s_NONE,&__pyx_n_s_hasattr,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    values[3] = __pyx_dynamic_args->__pyx_arg__DELETE;
    values[4] = __pyx_dynamic_args->__pyx_arg__EXPIRE;
    values[5] = __pyx_dynamic_args->__pyx_arg__RENEW;
    values[6] = __pyx_dynamic_args->__pyx_arg__CLEAR;
    values[7] = __pyx_dynamic_args->__pyx_arg_NONE;
    values[8] = __pyx_dynamic_args->__pyx_arg__NONE;
    values[9] = __pyx_dynamic_args->__pyx_arg_hasattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 10, 1); __PYX_ERR(0, 656, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DELETE);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_EXPIRE);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RENEW);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_CLEAR);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE_2);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "getTtl") < 0)) __PYX_ERR(0, 656, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
    __pyx_v__DELETE = values[3];
    __pyx_v__EXPIRE = values[4];
    __pyx_v__RENEW = values[5];
    __pyx_v__CLEAR = values[6];
    __pyx_v_NONE = values[7];
    __pyx_v__NONE = values[8];
    __pyx_v_hasattr = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 656, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_28getTtl(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default, __pyx_v__DELETE, __pyx_v__EXPIRE, __pyx_v__RENEW, __pyx_v__CLEAR, __pyx_v_NONE, __pyx_v__NONE, __pyx_v_hasattr, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_28getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_ettl = NULL;
  PyObject *__pyx_v_writer = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_ttl = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTtl", 0);

  /* "chorde/clients/async.py":661
 *             hasattr = hasattr,
 *             **kw):
 *         ettl = None             # <<<<<<<<<<<<<<
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_ettl = Py_None;

  /* "chorde/clients/async.py":662
 *             **kw):
 *         ettl = None
 *         writer = self.writer             # <<<<<<<<<<<<<<
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_writer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":663
 *         ettl = None
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 */
  __pyx_t_2 = (__pyx_v_writer != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":665
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)             # <<<<<<<<<<<<<<
 *             if value is not _NONE:
 *                 value, ttl, _ = value
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_v__NONE};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_v__NONE};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
      __Pyx_INCREF(__pyx_v__NONE);
      __Pyx_GIVEREF(__pyx_v__NONE);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v__NONE);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":666
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 *             if value is not _NONE:             # <<<<<<<<<<<<<<
 *                 value, ttl, _ = value
 *                 if value is _DELETE:
 */
    __pyx_t_3 = (__pyx_v_value != __pyx_v__NONE);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":667
 *             value = writer.getTtl(key, _NONE)
 *             if value is not _NONE:
 *                 value, ttl, _ = value             # <<<<<<<<<<<<<<
 *                 if value is _DELETE:
 *                     # Deletion means a miss... right?
 */
      if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) {
        PyObject* sequence = __pyx_v_value;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 667, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 3) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L6_unpacking_done;
        __pyx_L5_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 667, __pyx_L1_error)
        __pyx_L6_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_v_ttl = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v__ = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "chorde/clients/async.py":668
 *             if value is not _NONE:
 *                 value, ttl, _ = value
 *                 if value is _DELETE:             # <<<<<<<<<<<<<<
 *                     # Deletion means a miss... right?
 *                     if default is NONE:
 */
      __pyx_t_2 = (__pyx_v_value == __pyx_v__DELETE);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":670
 *                 if value is _DELETE:
 *                     # Deletion means a miss... right?
 *                     if default is NONE:             # <<<<<<<<<<<<<<
 *                         raise CacheMissError, key
 *                     else:
 */
        __pyx_t_3 = (__pyx_v_default == __pyx_v_NONE);
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (unlikely(__pyx_t_2)) {

          /* "chorde/clients/async.py":671
 *                     # Deletion means a miss... right?
 *                     if default is NONE:
 *                         raise CacheMissError, key             # <<<<<<<<<<<<<<
 *                     else:
 *                         return default, -1
 */
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_Raise(__pyx_t_7, __pyx_v_key, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(0, 671, __pyx_L1_error)

          /* "chorde/clients/async.py":670
 *                 if value is _DELETE:
 *                     # Deletion means a miss... right?
 *                     if default is NONE:             # <<<<<<<<<<<<<<
 *                         raise CacheMissError, key
 *                     else:
 */
        }

        /* "chorde/clients/async.py":673
 *                         raise CacheMissError, key
 *                     else:
 *                         return default, -1             # <<<<<<<<<<<<<<
 *                 elif value is _EXPIRE:
 *                     # Expiration just sets the TTL
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 673, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_default);
          __Pyx_GIVEREF(__pyx_v_default);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_default);
          __Pyx_INCREF(__pyx_int_neg_1);
          __Pyx_GIVEREF(__pyx_int_neg_1);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
          __pyx_r = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L0;
        }

        /* "chorde/clients/async.py":668
 *             if value is not _NONE:
 *                 value, ttl, _ = value
 *                 if value is _DELETE:             # <<<<<<<<<<<<<<
 *                     # Deletion means a miss... right?
 *                     if default is NONE:
 */
      }

      /* "chorde/clients/async.py":674
 *                     else:
 *                         return default, -1
 *                 elif value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                     # Expiration just sets the TTL
 *                     ettl = -1
 */
      __pyx_t_2 = (__pyx_v_value == __pyx_v__EXPIRE);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":676
 *                 elif value is _EXPIRE:
 *                     # Expiration just sets the TTL
 *                     ettl = -1             # <<<<<<<<<<<<<<
 *                 elif value is _RENEW:
 *                     ettl = ttl
 */
        __Pyx_INCREF(__pyx_int_neg_1);
        __Pyx_DECREF_SET(__pyx_v_ettl, __pyx_int_neg_1);

        /* "chorde/clients/async.py":674
 *                     else:
 *                         return default, -1
 *                 elif value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                     # Expiration just sets the TTL
 *                     ettl = -1
 */
        goto __pyx_L7;
      }

      /* "chorde/clients/async.py":677
 *                     # Expiration just sets the TTL
 *                     ettl = -1
 *                 elif value is _RENEW:             # <<<<<<<<<<<<<<
 *                     ettl = ttl
 *                 elif not hasattr(value, 'undefer'):
 */
      __pyx_t_3 = (__pyx_v_value == __pyx_v__RENEW);
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":678
 *                     ettl = -1
 *                 elif value is _RENEW:
 *                     ettl = ttl             # <<<<<<<<<<<<<<
 *                 elif not hasattr(value, 'undefer'):
 *                     return value, ttl
 */
        __Pyx_INCREF(__pyx_v_ttl);
        __Pyx_DECREF_SET(__pyx_v_ettl, __pyx_v_ttl);

        /* "chorde/clients/async.py":677
 *                     # Expiration just sets the TTL
 *                     ettl = -1
 *                 elif value is _RENEW:             # <<<<<<<<<<<<<<
 *                     ettl = ttl
 *                 elif not hasattr(value, 'undefer'):
 */
        goto __pyx_L7;
      }

      /* "chorde/clients/async.py":679
 *                 elif value is _RENEW:
 *                     ettl = ttl
 *                 elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     return value, ttl
 *             # Yep, _NONE when querying the writer, because we don't want
 */
      __Pyx_INCREF(__pyx_v_hasattr);
      __pyx_t_4 = __pyx_v_hasattr; __pyx_t_1 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_value, __pyx_n_s_undefer};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_value, __pyx_n_s_undefer};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_value);
        __Pyx_INCREF(__pyx_n_s_undefer);
        __Pyx_GIVEREF(__pyx_n_s_undefer);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_undefer);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 679, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":680
 *                     ettl = ttl
 *                 elif not hasattr(value, 'undefer'):
 *                     return value, ttl             # <<<<<<<<<<<<<<
 *             # Yep, _NONE when querying the writer, because we don't want
 *             # to return a default if the writer doesn't have it, we must
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_value);
        __Pyx_INCREF(__pyx_v_ttl);
        __Pyx_GIVEREF(__pyx_v_ttl);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_ttl);
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "chorde/clients/async.py":679
 *                 elif value is _RENEW:
 *                     ettl = ttl
 *                 elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     return value, ttl
 *             # Yep, _NONE when querying the writer, because we don't want
 */
      }
      __pyx_L7:;

      /* "chorde/clients/async.py":666
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 *             if value is not _NONE:             # <<<<<<<<<<<<<<
 *                 value, ttl, _ = value
 *                 if value is _DELETE:
 */
    }

    /* "chorde/clients/async.py":686
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 # Well,
 *                 if default is NONE:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_contains_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v__CLEAR) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v__CLEAR);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 686, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_3) {

      /* "chorde/clients/async.py":688
 *             if writer._contains(_CLEAR):
 *                 # Well,
 *                 if default is NONE:             # <<<<<<<<<<<<<<
 *                     raise CacheMissError, key
 *                 else:
 */
      __pyx_t_3 = (__pyx_v_default == __pyx_v_NONE);
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (unlikely(__pyx_t_2)) {

        /* "chorde/clients/async.py":689
 *                 # Well,
 *                 if default is NONE:
 *                     raise CacheMissError, key             # <<<<<<<<<<<<<<
 *                 else:
 *                     return default, -1
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_Raise(__pyx_t_7, __pyx_v_key, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 689, __pyx_L1_error)

        /* "chorde/clients/async.py":688
 *             if writer._contains(_CLEAR):
 *                 # Well,
 *                 if default is NONE:             # <<<<<<<<<<<<<<
 *                     raise CacheMissError, key
 *                 else:
 */
      }

      /* "chorde/clients/async.py":691
 *                     raise CacheMissError, key
 *                 else:
 *                     return default, -1             # <<<<<<<<<<<<<<
 * 
 *         # Ok, read the cache then
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_default);
        __Pyx_GIVEREF(__pyx_v_default);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_default);
        __Pyx_INCREF(__pyx_int_neg_1);
        __Pyx_GIVEREF(__pyx_int_neg_1);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;
      }

      /* "chorde/clients/async.py":686
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 # Well,
 *                 if default is NONE:
 */
    }

    /* "chorde/clients/async.py":663
 *         ettl = None
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 */
  }

  /* "chorde/clients/async.py":694
 * 
 *         # Ok, read the cache then
 *         value, ttl = self.client.getTtl(key, default, **kw)             # <<<<<<<<<<<<<<
 *         if ettl is not None:
 *             ttl = ettl
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_default);
  __pyx_t_5 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 694, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_7);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L12_unpacking_done;
    __pyx_L11_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 694, __pyx_L1_error)
    __pyx_L12_unpacking_done:;
  }
  __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_XDECREF_SET(__pyx_v_ttl, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "chorde/clients/async.py":695
 *         # Ok, read the cache then
 *         value, ttl = self.client.getTtl(key, default, **kw)
 *         if ettl is not None:             # <<<<<<<<<<<<<<
 *             ttl = ettl
 *         if value is NONE:
 */
  __pyx_t_2 = (__pyx_v_ettl != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":696
 *         value, ttl = self.client.getTtl(key, default, **kw)
 *         if ettl is not None:
 *             ttl = ettl             # <<<<<<<<<<<<<<
 *         if value is NONE:
 *             raise CacheMissError, key
 */
    __Pyx_INCREF(__pyx_v_ettl);
    __Pyx_DECREF_SET(__pyx_v_ttl, __pyx_v_ettl);

    /* "chorde/clients/async.py":695
 *         # Ok, read the cache then
 *         value, ttl = self.client.getTtl(key, default, **kw)
 *         if ettl is not None:             # <<<<<<<<<<<<<<
 *             ttl = ettl
 *         if value is NONE:
 */
  }

  /* "chorde/clients/async.py":697
 *         if ettl is not None:
 *             ttl = ettl
 *         if value is NONE:             # <<<<<<<<<<<<<<
 *             raise CacheMissError, key
 *         else:
 */
  __pyx_t_3 = (__pyx_v_value == __pyx_v_NONE);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "chorde/clients/async.py":698
 *             ttl = ettl
 *         if value is NONE:
 *             raise CacheMissError, key             # <<<<<<<<<<<<<<
 *         else:
 *             return value, ttl
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, __pyx_v_key, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 698, __pyx_L1_error)

    /* "chorde/clients/async.py":697
 *         if ettl is not None:
 *             ttl = ettl
 *         if value is NONE:             # <<<<<<<<<<<<<<
 *             raise CacheMissError, key
 *         else:
 */
  }

  /* "chorde/clients/async.py":700
 *             raise CacheMissError, key
 *         else:
 *             return value, ttl             # <<<<<<<<<<<<<<
 * 
 *     def get(self, key, default = NONE, ttl_skip = None,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
    __Pyx_INCREF(__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ttl);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":656
 *             self.writer.purge()
 * 
 *     def getTtl(self, key, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ettl);
  __Pyx_XDECREF(__pyx_v_writer);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_ttl);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":702
 *             return value, ttl
 * 
 *     def get(self, key, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_default);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__DELETE);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__EXPIRE);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__RENEW);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__CLEAR);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_hasattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_31get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_31get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_31get, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_31get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v_ttl_skip = 0;
  PyObject *__pyx_v__DELETE = 0;
  PyObject *__pyx_v__EXPIRE = 0;
  PyObject *__pyx_v__RENEW = 0;
  PyObject *__pyx_v__CLEAR = 0;
  PyObject *__pyx_v_NONE = 0;
  PyObject *__pyx_v__NONE = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,&__pyx_n_s_ttl_skip,&__pyx_n_s_DELETE,&__pyx_n_s_EXPIRE,&__pyx_n_s_RENEW,&__pyx_n_s_CLEAR,&__pyx_n_s_NONE_2,&__pyx_n_s_NONE,&__pyx_n_s_hasattr,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = __pyx_dynamic_args->__pyx_arg__DELETE;
    values[5] = __pyx_dynamic_args->__pyx_arg__EXPIRE;
    values[6] = __pyx_dynamic_args->__pyx_arg__RENEW;
    values[7] = __pyx_dynamic_args->__pyx_arg__CLEAR;
    values[8] = __pyx_dynamic_args->__pyx_arg_NONE;
    values[9] = __pyx_dynamic_args->__pyx_arg__NONE;
    values[10] = __pyx_dynamic_args->__pyx_arg_hasattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get", 0, 2, 11, 1); __PYX_ERR(0, 702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl_skip);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DELETE);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_EXPIRE);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RENEW);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_CLEAR);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE_2);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[10] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "get") < 0)) __PYX_ERR(0, 702, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
    __pyx_v_ttl_skip = values[3];
    __pyx_v__DELETE = values[4];
    __pyx_v__EXPIRE = values[5];
    __pyx_v__RENEW = values[6];
    __pyx_v__CLEAR = values[7];
    __pyx_v_NONE = values[8];
    __pyx_v__NONE = values[9];
    __pyx_v_hasattr = values[10];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 0, 2, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 702, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_30get(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default, __pyx_v_ttl_skip, __pyx_v__DELETE, __pyx_v__EXPIRE, __pyx_v__RENEW, __pyx_v__CLEAR, __pyx_v_NONE, __pyx_v__NONE, __pyx_v_hasattr, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_30get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_ttl_skip, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_writer = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_ttl = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __Pyx_INCREF(__pyx_v_ttl_skip);

  /* "chorde/clients/async.py":707
 *             hasattr = hasattr,
 *             **kw):
 *         writer = self.writer             # <<<<<<<<<<<<<<
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_writer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":708
 *             **kw):
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 */
  __pyx_t_2 = (__pyx_v_writer != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":710
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)             # <<<<<<<<<<<<<<
 *             if value is not _NONE:
 *                 value, ttl, _ = value
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_v__NONE};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_v__NONE};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
      __Pyx_INCREF(__pyx_v__NONE);
      __Pyx_GIVEREF(__pyx_v__NONE);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v__NONE);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":711
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 *             if value is not _NONE:             # <<<<<<<<<<<<<<
 *                 value, ttl, _ = value
 *                 if value is _DELETE or value is _EXPIRE:
 */
    __pyx_t_3 = (__pyx_v_value != __pyx_v__NONE);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":712
 *             value = writer.getTtl(key, _NONE)
 *             if value is not _NONE:
 *                 value, ttl, _ = value             # <<<<<<<<<<<<<<
 *                 if value is _DELETE or value is _EXPIRE:
 *                     # Deletion means a miss... right?
 */
      if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) {
        PyObject* sequence = __pyx_v_value;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 712, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 3) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L6_unpacking_done;
        __pyx_L5_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 712, __pyx_L1_error)
        __pyx_L6_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_v_ttl = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v__ = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "chorde/clients/async.py":713
 *             if value is not _NONE:
 *                 value, ttl, _ = value
 *                 if value is _DELETE or value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                     # Deletion means a miss... right?
 *                     if default is NONE:
 */
      __pyx_t_3 = (__pyx_v_value == __pyx_v__DELETE);
      __pyx_t_9 = (__pyx_t_3 != 0);
      if (!__pyx_t_9) {
      } else {
        __pyx_t_2 = __pyx_t_9;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_9 = (__pyx_v_value == __pyx_v__EXPIRE);
      __pyx_t_3 = (__pyx_t_9 != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":715
 *                 if value is _DELETE or value is _EXPIRE:
 *                     # Deletion means a miss... right?
 *                     if default is NONE:             # <<<<<<<<<<<<<<
 *                         raise CacheMissError, key
 *                     else:
 */
        __pyx_t_2 = (__pyx_v_default == __pyx_v_NONE);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (unlikely(__pyx_t_3)) {

          /* "chorde/clients/async.py":716
 *                     # Deletion means a miss... right?
 *                     if default is NONE:
 *                         raise CacheMissError, key             # <<<<<<<<<<<<<<
 *                     else:
 *                         return default
 */
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 716, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_Raise(__pyx_t_7, __pyx_v_key, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(0, 716, __pyx_L1_error)

          /* "chorde/clients/async.py":715
 *                 if value is _DELETE or value is _EXPIRE:
 *                     # Deletion means a miss... right?
 *                     if default is NONE:             # <<<<<<<<<<<<<<
 *                         raise CacheMissError, key
 *                     else:
 */
        }

        /* "chorde/clients/async.py":718
 *                         raise CacheMissError, key
 *                     else:
 *                         return default             # <<<<<<<<<<<<<<
 *                 elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):
 *                     # The value is renewed, ttl_skip will be meaningless
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_default);
          __pyx_r = __pyx_v_default;
          goto __pyx_L0;
        }

        /* "chorde/clients/async.py":713
 *             if value is not _NONE:
 *                 value, ttl, _ = value
 *                 if value is _DELETE or value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                     # Deletion means a miss... right?
 *                     if default is NONE:
 */
      }

      /* "chorde/clients/async.py":719
 *                     else:
 *                         return default
 *                 elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):             # <<<<<<<<<<<<<<
 *                     # The value is renewed, ttl_skip will be meaningless
 *                     ttl_skip = None
 */
      __pyx_t_2 = (__pyx_v_value == __pyx_v__RENEW);
      __pyx_t_9 = (__pyx_t_2 != 0);
      if (__pyx_t_9) {
      } else {
        __pyx_t_3 = __pyx_t_9;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_9 = (__pyx_v_ttl_skip == Py_None);
      __pyx_t_2 = (__pyx_t_9 != 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_3 = __pyx_t_2;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_7 = PyObject_RichCompare(__pyx_v_ttl, __pyx_v_ttl_skip, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 719, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_3) {

        /* "chorde/clients/async.py":721
 *                 elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):
 *                     # The value is renewed, ttl_skip will be meaningless
 *                     ttl_skip = None             # <<<<<<<<<<<<<<
 *                 elif not hasattr(value, 'undefer'):
 *                     return value
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF_SET(__pyx_v_ttl_skip, Py_None);

        /* "chorde/clients/async.py":719
 *                     else:
 *                         return default
 *                 elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):             # <<<<<<<<<<<<<<
 *                     # The value is renewed, ttl_skip will be meaningless
 *                     ttl_skip = None
 */
        goto __pyx_L7;
      }

      /* "chorde/clients/async.py":722
 *                     # The value is renewed, ttl_skip will be meaningless
 *                     ttl_skip = None
 *                 elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     return value
 *             # Yep, _NONE when querying the writer, because we don't want
 */
      __Pyx_INCREF(__pyx_v_hasattr);
      __pyx_t_4 = __pyx_v_hasattr; __pyx_t_1 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_value, __pyx_n_s_undefer};
        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_value, __pyx_n_s_undefer};
        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_7);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_value);
        __Pyx_INCREF(__pyx_n_s_undefer);
        __Pyx_GIVEREF(__pyx_n_s_undefer);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_undefer);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = ((!__pyx_t_3) != 0);
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":723
 *                     ttl_skip = None
 *                 elif not hasattr(value, 'undefer'):
 *                     return value             # <<<<<<<<<<<<<<
 *             # Yep, _NONE when querying the writer, because we don't want
 *             # to return a default if the writer doesn't have it, we must
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_value);
        __pyx_r = __pyx_v_value;
        goto __pyx_L0;

        /* "chorde/clients/async.py":722
 *                     # The value is renewed, ttl_skip will be meaningless
 *                     ttl_skip = None
 *                 elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                     return value
 *             # Yep, _NONE when querying the writer, because we don't want
 */
      }
      __pyx_L7:;

      /* "chorde/clients/async.py":711
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 *             if value is not _NONE:             # <<<<<<<<<<<<<<
 *                 value, ttl, _ = value
 *                 if value is _DELETE or value is _EXPIRE:
 */
    }

    /* "chorde/clients/async.py":729
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 # Well,
 *                 if default is NONE:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_contains_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v__CLEAR) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v__CLEAR);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 729, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":731
 *             if writer._contains(_CLEAR):
 *                 # Well,
 *                 if default is NONE:             # <<<<<<<<<<<<<<
 *                     raise CacheMissError, key
 *                 else:
 */
      __pyx_t_2 = (__pyx_v_default == __pyx_v_NONE);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (unlikely(__pyx_t_3)) {

        /* "chorde/clients/async.py":732
 *                 # Well,
 *                 if default is NONE:
 *                     raise CacheMissError, key             # <<<<<<<<<<<<<<
 *                 else:
 *                     return default
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_Raise(__pyx_t_7, __pyx_v_key, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 732, __pyx_L1_error)

        /* "chorde/clients/async.py":731
 *             if writer._contains(_CLEAR):
 *                 # Well,
 *                 if default is NONE:             # <<<<<<<<<<<<<<
 *                     raise CacheMissError, key
 *                 else:
 */
      }

      /* "chorde/clients/async.py":734
 *                     raise CacheMissError, key
 *                 else:
 *                     return default             # <<<<<<<<<<<<<<
 * 
 *         # Ok, read the cache then
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_default);
        __pyx_r = __pyx_v_default;
        goto __pyx_L0;
      }

      /* "chorde/clients/async.py":729
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 # Well,
 *                 if default is NONE:
 */
    }

    /* "chorde/clients/async.py":708
 *             **kw):
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             value = writer.getTtl(key, _NONE)
 */
  }

  /* "chorde/clients/async.py":737
 * 
 *         # Ok, read the cache then
 *         return self.client.get(key, default, ttl_skip = ttl_skip, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def getTtlMulti(self, keys, default = NONE,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_default);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ttl_skip, __pyx_v_ttl_skip) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_1;
  __pyx_t_1 = 0;
  if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kw) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":702
 *             return value, ttl
 * 
 *     def get(self, key, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_writer);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_ttl);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_ttl_skip);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6chorde_7clients_5async_21AsyncWriteCacheClient_34generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "chorde/clients/async.py":739
 *         return self.client.get(key, default, ttl_skip = ttl_skip, **kw)
 * 
 *     def getTtlMulti(self, keys, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_default);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__DELETE);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__EXPIRE);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__RENEW);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__CLEAR);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg__NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_hasattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_33getTtlMulti(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_33getTtlMulti = {"getTtlMulti", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_33getTtlMulti, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_33getTtlMulti(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_keys = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v__DELETE = 0;
  PyObject *__pyx_v__EXPIRE = 0;
  PyObject *__pyx_v__RENEW = 0;
  PyObject *__pyx_v__CLEAR = 0;
  CYTHON_UNUSED PyObject *__pyx_v_NONE = 0;
  PyObject *__pyx_v__NONE = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTtlMulti (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_keys,&__pyx_n_s_default,&__pyx_n_s_DELETE,&__pyx_n_s_EXPIRE,&__pyx_n_s_RENEW,&__pyx_n_s_CLEAR,&__pyx_n_s_NONE_2,&__pyx_n_s_NONE,&__pyx_n_s_hasattr,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults5 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    values[3] = __pyx_dynamic_args->__pyx_arg__DELETE;
    values[4] = __pyx_dynamic_args->__pyx_arg__EXPIRE;
    values[5] = __pyx_dynamic_args->__pyx_arg__RENEW;
    values[6] = __pyx_dynamic_args->__pyx_arg__CLEAR;
    values[7] = __pyx_dynamic_args->__pyx_arg_NONE;
    values[8] = __pyx_dynamic_args->__pyx_arg__NONE;
    values[9] = __pyx_dynamic_args->__pyx_arg_hasattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getTtlMulti", 0, 2, 10, 1); __PYX_ERR(0, 739, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DELETE);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_EXPIRE);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RENEW);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_CLEAR);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE_2);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "getTtlMulti") < 0)) __PYX_ERR(0, 739, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_keys = values[1];
    __pyx_v_default = values[2];
    __pyx_v__DELETE = values[3];
    __pyx_v__EXPIRE = values[4];
    __pyx_v__RENEW = values[5];
    __pyx_v__CLEAR = values[6];
    __pyx_v_NONE = values[7];
    __pyx_v__NONE = values[8];
    __pyx_v_hasattr = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getTtlMulti", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 739, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_kw);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.getTtlMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_32getTtlMulti(__pyx_self, __pyx_v_self, __pyx_v_keys, __pyx_v_default, __pyx_v__DELETE, __pyx_v__EXPIRE, __pyx_v__RENEW, __pyx_v__CLEAR, __pyx_v_NONE, __pyx_v__NONE, __pyx_v_hasattr, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_32getTtlMulti(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_default, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, CYTHON_UNUSED PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTtlMulti", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 739, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys);
  __pyx_cur_scope->__pyx_v_default = __pyx_v_default;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
  __pyx_cur_scope->__pyx_v__DELETE = __pyx_v__DELETE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__DELETE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__DELETE);
  __pyx_cur_scope->__pyx_v__EXPIRE = __pyx_v__EXPIRE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__EXPIRE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__EXPIRE);
  __pyx_cur_scope->__pyx_v__RENEW = __pyx_v__RENEW;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__RENEW);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__RENEW);
  __pyx_cur_scope->__pyx_v__CLEAR = __pyx_v__CLEAR;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__CLEAR);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__CLEAR);
  __pyx_cur_scope->__pyx_v_NONE = __pyx_v_NONE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_NONE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_NONE);
  __pyx_cur_scope->__pyx_v__NONE = __pyx_v__NONE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__NONE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__NONE);
  __pyx_cur_scope->__pyx_v_hasattr = __pyx_v_hasattr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hasattr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hasattr);
  __pyx_cur_scope->__pyx_v_kw = __pyx_v_kw;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kw);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kw);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6chorde_7clients_5async_21AsyncWriteCacheClient_34generator, __pyx_codeobj__9, (PyObject *) __pyx_cur_scope, __pyx_n_s_getTtlMulti, __pyx_n_s_AsyncWriteCacheClient_getTtlMult, __pyx_n_s_chorde_clients_async); if (unlikely(!gen)) __PYX_ERR(0, 739, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.getTtlMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6chorde_7clients_5async_21AsyncWriteCacheClient_34generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *__pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTtlMulti", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L11_resume_from_yield;
    case 2: goto __pyx_L12_resume_from_yield;
    case 3: goto __pyx_L16_resume_from_yield;
    case 4: goto __pyx_L23_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 739, __pyx_L1_error)

  /* "chorde/clients/async.py":744
 *             hasattr = hasattr,
 *             **kw):
 *         ettl = {}             # <<<<<<<<<<<<<<
 *         writer = self.writer
 *         default_rv = (default, -1)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ettl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":745
 *             **kw):
 *         ettl = {}
 *         writer = self.writer             # <<<<<<<<<<<<<<
 *         default_rv = (default, -1)
 *         if writer is not None: # self.is_started() inlined for speed
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_writer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":746
 *         ettl = {}
 *         writer = self.writer
 *         default_rv = (default, -1)             # <<<<<<<<<<<<<<
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_default);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_default_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":747
 *         writer = self.writer
 *         default_rv = (default, -1)
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_writer != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":749
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl             # <<<<<<<<<<<<<<
 *             nkeys = []
 *             nkeys_append = nkeys.append
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_writer, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_wgetTtl = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":750
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl
 *             nkeys = []             # <<<<<<<<<<<<<<
 *             nkeys_append = nkeys.append
 *             for key in keys:
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_nkeys = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":751
 *             wgetTtl = writer.getTtl
 *             nkeys = []
 *             nkeys_append = nkeys.append             # <<<<<<<<<<<<<<
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_nkeys, __pyx_n_s_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_nkeys_append = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":752
 *             nkeys = []
 *             nkeys_append = nkeys.append
 *             for key in keys:             # <<<<<<<<<<<<<<
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:
 */
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 752, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 752, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 752, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 752, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 752, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "chorde/clients/async.py":753
 *             nkeys_append = nkeys.append
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)             # <<<<<<<<<<<<<<
 *                 if value is not _NONE:
 *                     value, ttl, _ = value
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wgetTtl);
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_wgetTtl; __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v__NONE};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v__NONE};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_cur_scope->__pyx_v_key);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v__NONE);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__NONE);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v__NONE);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "chorde/clients/async.py":754
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:             # <<<<<<<<<<<<<<
 *                     value, ttl, _ = value
 *                     if value is _DELETE:
 */
      __pyx_t_3 = (__pyx_cur_scope->__pyx_v_value != __pyx_cur_scope->__pyx_v__NONE);
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":755
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:
 *                     value, ttl, _ = value             # <<<<<<<<<<<<<<
 *                     if value is _DELETE:
 *                         # Deletion means a miss... right?
 */
        if ((likely(PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_value))) || (PyList_CheckExact(__pyx_cur_scope->__pyx_v_value))) {
          PyObject* sequence = __pyx_cur_scope->__pyx_v_value;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 755, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          Py_ssize_t index = -1;
          __pyx_t_8 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 2; __pyx_t_10 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 3) < 0) __PYX_ERR(0, 755, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L9_unpacking_done;
          __pyx_L8_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 755, __pyx_L1_error)
          __pyx_L9_unpacking_done:;
        }
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_value);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ttl);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ttl, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;

        /* "chorde/clients/async.py":756
 *                 if value is not _NONE:
 *                     value, ttl, _ = value
 *                     if value is _DELETE:             # <<<<<<<<<<<<<<
 *                         # Deletion means a miss... right?
 *                         yield key, default_rv
 */
        __pyx_t_2 = (__pyx_cur_scope->__pyx_v_value == __pyx_cur_scope->__pyx_v__DELETE);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {

          /* "chorde/clients/async.py":758
 *                     if value is _DELETE:
 *                         # Deletion means a miss... right?
 *                         yield key, default_rv             # <<<<<<<<<<<<<<
 *                         continue
 *                     elif value is _EXPIRE:
 */
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 758, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_key);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_rv);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_rv);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_default_rv);
          __pyx_r = __pyx_t_10;
          __pyx_t_10 = 0;
          __Pyx_XGIVEREF(__pyx_t_1);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, yielding value */
          __pyx_generator->resume_label = 1;
          return __pyx_r;
          __pyx_L11_resume_from_yield:;
          __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 758, __pyx_L1_error)

          /* "chorde/clients/async.py":759
 *                         # Deletion means a miss... right?
 *                         yield key, default_rv
 *                         continue             # <<<<<<<<<<<<<<
 *                     elif value is _EXPIRE:
 *                         # Expiration just sets the TTL
 */
          goto __pyx_L5_continue;

          /* "chorde/clients/async.py":756
 *                 if value is not _NONE:
 *                     value, ttl, _ = value
 *                     if value is _DELETE:             # <<<<<<<<<<<<<<
 *                         # Deletion means a miss... right?
 *                         yield key, default_rv
 */
        }

        /* "chorde/clients/async.py":760
 *                         yield key, default_rv
 *                         continue
 *                     elif value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                         # Expiration just sets the TTL
 *                         ettl[key] = -1
 */
        __pyx_t_3 = (__pyx_cur_scope->__pyx_v_value == __pyx_cur_scope->__pyx_v__EXPIRE);
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {

          /* "chorde/clients/async.py":762
 *                     elif value is _EXPIRE:
 *                         # Expiration just sets the TTL
 *                         ettl[key] = -1             # <<<<<<<<<<<<<<
 *                     elif value is _RENEW:
 *                         ettl[key] = ttl
 */
          if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_ettl, __pyx_cur_scope->__pyx_v_key, __pyx_int_neg_1) < 0)) __PYX_ERR(0, 762, __pyx_L1_error)

          /* "chorde/clients/async.py":760
 *                         yield key, default_rv
 *                         continue
 *                     elif value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                         # Expiration just sets the TTL
 *                         ettl[key] = -1
 */
          goto __pyx_L10;
        }

        /* "chorde/clients/async.py":763
 *                         # Expiration just sets the TTL
 *                         ettl[key] = -1
 *                     elif value is _RENEW:             # <<<<<<<<<<<<<<
 *                         ettl[key] = ttl
 *                     elif not hasattr(value, 'undefer'):
 */
        __pyx_t_2 = (__pyx_cur_scope->__pyx_v_value == __pyx_cur_scope->__pyx_v__RENEW);
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {

          /* "chorde/clients/async.py":764
 *                         ettl[key] = -1
 *                     elif value is _RENEW:
 *                         ettl[key] = ttl             # <<<<<<<<<<<<<<
 *                     elif not hasattr(value, 'undefer'):
 *                         yield key, (value, ttl)
 */
          if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_ettl, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_ttl) < 0)) __PYX_ERR(0, 764, __pyx_L1_error)

          /* "chorde/clients/async.py":763
 *                         # Expiration just sets the TTL
 *                         ettl[key] = -1
 *                     elif value is _RENEW:             # <<<<<<<<<<<<<<
 *                         ettl[key] = ttl
 *                     elif not hasattr(value, 'undefer'):
 */
          goto __pyx_L10;
        }

        /* "chorde/clients/async.py":765
 *                     elif value is _RENEW:
 *                         ettl[key] = ttl
 *                     elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                         yield key, (value, ttl)
 *                         continue
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hasattr);
        __pyx_t_7 = __pyx_cur_scope->__pyx_v_hasattr; __pyx_t_6 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_value, __pyx_n_s_undefer};
          __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 765, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_value, __pyx_n_s_undefer};
          __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 765, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 765, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_cur_scope->__pyx_v_value);
          __Pyx_INCREF(__pyx_n_s_undefer);
          __Pyx_GIVEREF(__pyx_n_s_undefer);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_n_s_undefer);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 765, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 765, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_2 = ((!__pyx_t_3) != 0);
        if (__pyx_t_2) {

          /* "chorde/clients/async.py":766
 *                         ettl[key] = ttl
 *                     elif not hasattr(value, 'undefer'):
 *                         yield key, (value, ttl)             # <<<<<<<<<<<<<<
 *                         continue
 *                 # Yep, _NONE when querying the writer, because we don't want
 */
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 766, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_value);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ttl);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ttl);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_ttl);
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_key);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
          __pyx_t_10 = 0;
          __pyx_r = __pyx_t_7;
          __pyx_t_7 = 0;
          __Pyx_XGIVEREF(__pyx_t_1);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, yielding value */
          __pyx_generator->resume_label = 2;
          return __pyx_r;
          __pyx_L12_resume_from_yield:;
          __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 766, __pyx_L1_error)

          /* "chorde/clients/async.py":767
 *                     elif not hasattr(value, 'undefer'):
 *                         yield key, (value, ttl)
 *                         continue             # <<<<<<<<<<<<<<
 *                 # Yep, _NONE when querying the writer, because we don't want
 *                 # to return a default if the writer doesn't have it, we must
 */
          goto __pyx_L5_continue;

          /* "chorde/clients/async.py":765
 *                     elif value is _RENEW:
 *                         ettl[key] = ttl
 *                     elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                         yield key, (value, ttl)
 *                         continue
 */
        }
        __pyx_L10:;

        /* "chorde/clients/async.py":754
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:             # <<<<<<<<<<<<<<
 *                     value, ttl, _ = value
 *                     if value is _DELETE:
 */
      }

      /* "chorde/clients/async.py":771
 *                 # to return a default if the writer doesn't have it, we must
 *                 # still check the client.
 *                 nkeys_append(key)             # <<<<<<<<<<<<<<
 *             keys = nkeys
 *             del nkeys, nkeys_append
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nkeys_append);
      __pyx_t_10 = __pyx_cur_scope->__pyx_v_nkeys_append; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_cur_scope->__pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_cur_scope->__pyx_v_key);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "chorde/clients/async.py":752
 *             nkeys = []
 *             nkeys_append = nkeys.append
 *             for key in keys:             # <<<<<<<<<<<<<<
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:
 */
      __pyx_L5_continue:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":772
 *                 # still check the client.
 *                 nkeys_append(key)
 *             keys = nkeys             # <<<<<<<<<<<<<<
 *             del nkeys, nkeys_append
 * 
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nkeys);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_keys);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_keys, __pyx_cur_scope->__pyx_v_nkeys);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nkeys);

    /* "chorde/clients/async.py":773
 *                 nkeys_append(key)
 *             keys = nkeys
 *             del nkeys, nkeys_append             # <<<<<<<<<<<<<<
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 */
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_nkeys);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_nkeys);
    __pyx_cur_scope->__pyx_v_nkeys = NULL;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_nkeys_append);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_nkeys_append);
    __pyx_cur_scope->__pyx_v_nkeys_append = NULL;

    /* "chorde/clients/async.py":776
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 for key in keys:
 *                     yield key, default_rv
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_writer, __pyx_n_s_contains_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_cur_scope->__pyx_v__CLEAR) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_cur_scope->__pyx_v__CLEAR);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":777
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):
 *                 for key in keys:             # <<<<<<<<<<<<<<
 *                     yield key, default_rv
 *                 return
 */
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) {
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
        __pyx_t_5 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 777, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 777, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 777, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_5(__pyx_t_1);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 777, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;

        /* "chorde/clients/async.py":778
 *             if writer._contains(_CLEAR):
 *                 for key in keys:
 *                     yield key, default_rv             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 778, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_key);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default_rv);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default_rv);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_default_rv);
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L16_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 778, __pyx_L1_error)

        /* "chorde/clients/async.py":777
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):
 *                 for key in keys:             # <<<<<<<<<<<<<<
 *                     yield key, default_rv
 *                 return
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":779
 *                 for key in keys:
 *                     yield key, default_rv
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         # Ok, read the cache then
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = NULL;
      goto __pyx_L0;

      /* "chorde/clients/async.py":776
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 for key in keys:
 *                     yield key, default_rv
 */
    }

    /* "chorde/clients/async.py":747
 *         writer = self.writer
 *         default_rv = (default, -1)
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl
 */
  }

  /* "chorde/clients/async.py":782
 * 
 *         # Ok, read the cache then
 *         ettlget = ettl.get             # <<<<<<<<<<<<<<
 *         for key, (value, ttl) in self.client.getTtlMulti(keys, default, **kw):
 *             ttl = ettlget(key, ttl)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ettl, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ettlget = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":783
 *         # Ok, read the cache then
 *         ettlget = ettl.get
 *         for key, (value, ttl) in self.client.getTtlMulti(keys, default, **kw):             # <<<<<<<<<<<<<<
 *             ttl = ettlget(key, ttl)
 *             yield key, (value, ttl)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getTtlMulti); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_keys);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_default);
  __pyx_t_10 = PyDict_Copy(__pyx_cur_scope->__pyx_v_kw); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_10 = __pyx_t_8; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_10))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 783, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 783, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_5(__pyx_t_10);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 783, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
      PyObject* sequence = __pyx_t_8;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 783, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 783, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L20_unpacking_done;
      __pyx_L19_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 783, __pyx_L1_error)
      __pyx_L20_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 783, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_12);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      #endif
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_13)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L21_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_12 = __pyx_t_11(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L21_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_12);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_13), 2) < 0) __PYX_ERR(0, 783, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L22_unpacking_done;
      __pyx_L21_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 783, __pyx_L1_error)
      __pyx_L22_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ttl);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ttl, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;

    /* "chorde/clients/async.py":784
 *         ettlget = ettl.get
 *         for key, (value, ttl) in self.client.getTtlMulti(keys, default, **kw):
 *             ttl = ettlget(key, ttl)             # <<<<<<<<<<<<<<
 *             yield key, (value, ttl)
 * 
 */
    __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_ettl, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_ttl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ttl);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ttl, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;

    /* "chorde/clients/async.py":785
 *         for key, (value, ttl) in self.client.getTtlMulti(keys, default, **kw):
 *             ttl = ettlget(key, ttl)
 *             yield key, (value, ttl)             # <<<<<<<<<<<<<<
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,
 */
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_value);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_cur_scope->__pyx_v_ttl);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_t_10);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_10;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 4;
    return __pyx_r;
    __pyx_L23_resume_from_yield:;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_10 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_10);
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 785, __pyx_L1_error)

    /* "chorde/clients/async.py":783
 *         # Ok, read the cache then
 *         ettlget = ettl.get
 *         for key, (value, ttl) in self.client.getTtlMulti(keys, default, **kw):             # <<<<<<<<<<<<<<
 *             ttl = ettlget(key, ttl)
 *             yield key, (value, ttl)
 */
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "chorde/clients/async.py":739
 *         return self.client.get(key, default, ttl_skip = ttl_skip, **kw)
 * 
 *     def getTtlMulti(self, keys, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("getTtlMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6chorde_7clients_5async_21AsyncWriteCacheClient_37generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "chorde/clients/async.py":787
 *             yield key, (value, ttl)
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_18__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_default);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__DELETE);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__DELETE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__EXPIRE);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__EXPIRE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__RENEW);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__RENEW);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__CLEAR);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__CLEAR);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__NONE);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__NONE);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg__NONE);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 8, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_hasattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_36getMulti(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_36getMulti = {"getMulti", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_36getMulti, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_36getMulti(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_keys = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v_ttl_skip = 0;
  PyObject *__pyx_v__DELETE = 0;
  PyObject *__pyx_v__EXPIRE = 0;
  PyObject *__pyx_v__RENEW = 0;
  PyObject *__pyx_v__CLEAR = 0;
  CYTHON_UNUSED PyObject *__pyx_v_NONE = 0;
  PyObject *__pyx_v__NONE = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getMulti (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_keys,&__pyx_n_s_default,&__pyx_n_s_ttl_skip,&__pyx_n_s_DELETE,&__pyx_n_s_EXPIRE,&__pyx_n_s_RENEW,&__pyx_n_s_CLEAR,&__pyx_n_s_NONE_2,&__pyx_n_s_NONE,&__pyx_n_s_hasattr,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults6 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = __pyx_dynamic_args->__pyx_arg__DELETE;
    values[5] = __pyx_dynamic_args->__pyx_arg__EXPIRE;
    values[6] = __pyx_dynamic_args->__pyx_arg__RENEW;
    values[7] = __pyx_dynamic_args->__pyx_arg__CLEAR;
    values[8] = __pyx_dynamic_args->__pyx_arg_NONE;
    values[9] = __pyx_dynamic_args->__pyx_arg__NONE;
    values[10] = __pyx_dynamic_args->__pyx_arg_hasattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getMulti", 0, 2, 11, 1); __PYX_ERR(0, 787, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl_skip);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DELETE);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_EXPIRE);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RENEW);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_CLEAR);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE_2);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NONE);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[10] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "getMulti") < 0)) __PYX_ERR(0, 787, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_keys = values[1];
    __pyx_v_default = values[2];
    __pyx_v_ttl_skip = values[3];
    __pyx_v__DELETE = values[4];
    __pyx_v__EXPIRE = values[5];
    __pyx_v__RENEW = values[6];
    __pyx_v__CLEAR = values[7];
    __pyx_v_NONE = values[8];
    __pyx_v__NONE = values[9];
    __pyx_v_hasattr = values[10];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMulti", 0, 2, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 787, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_kw);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.getMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_35getMulti(__pyx_self, __pyx_v_self, __pyx_v_keys, __pyx_v_default, __pyx_v_ttl_skip, __pyx_v__DELETE, __pyx_v__EXPIRE, __pyx_v__RENEW, __pyx_v__CLEAR, __pyx_v_NONE, __pyx_v__NONE, __pyx_v_hasattr, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_35getMulti(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_default, PyObject *__pyx_v_ttl_skip, PyObject *__pyx_v__DELETE, PyObject *__pyx_v__EXPIRE, PyObject *__pyx_v__RENEW, PyObject *__pyx_v__CLEAR, CYTHON_UNUSED PyObject *__pyx_v_NONE, PyObject *__pyx_v__NONE, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_kw) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMulti", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_1_getMulti(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_1_getMulti, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 787, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_keys = __pyx_v_keys;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys);
  __pyx_cur_scope->__pyx_v_default = __pyx_v_default;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
  __pyx_cur_scope->__pyx_v_ttl_skip = __pyx_v_ttl_skip;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ttl_skip);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ttl_skip);
  __pyx_cur_scope->__pyx_v__DELETE = __pyx_v__DELETE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__DELETE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__DELETE);
  __pyx_cur_scope->__pyx_v__EXPIRE = __pyx_v__EXPIRE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__EXPIRE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__EXPIRE);
  __pyx_cur_scope->__pyx_v__RENEW = __pyx_v__RENEW;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__RENEW);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__RENEW);
  __pyx_cur_scope->__pyx_v__CLEAR = __pyx_v__CLEAR;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__CLEAR);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__CLEAR);
  __pyx_cur_scope->__pyx_v_NONE = __pyx_v_NONE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_NONE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_NONE);
  __pyx_cur_scope->__pyx_v__NONE = __pyx_v__NONE;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v__NONE);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__NONE);
  __pyx_cur_scope->__pyx_v_hasattr = __pyx_v_hasattr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hasattr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hasattr);
  __pyx_cur_scope->__pyx_v_kw = __pyx_v_kw;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kw);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kw);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6chorde_7clients_5async_21AsyncWriteCacheClient_37generator1, __pyx_codeobj__10, (PyObject *) __pyx_cur_scope, __pyx_n_s_getMulti, __pyx_n_s_AsyncWriteCacheClient_getMulti, __pyx_n_s_chorde_clients_async); if (unlikely(!gen)) __PYX_ERR(0, 787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.getMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6chorde_7clients_5async_21AsyncWriteCacheClient_37generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *__pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getMulti", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L13_resume_from_yield;
    case 2: goto __pyx_L18_resume_from_yield;
    case 3: goto __pyx_L22_resume_from_yield;
    case 4: goto __pyx_L25_resume_from_yield;
    case 5: goto __pyx_L31_resume_from_yield;
    case 6: goto __pyx_L37_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 787, __pyx_L1_error)

  /* "chorde/clients/async.py":792
 *             hasattr = hasattr,
 *             **kw):
 *         ettl = []             # <<<<<<<<<<<<<<
 *         ettl_append = ettl.append
 *         writer = self.writer
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ettl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":793
 *             **kw):
 *         ettl = []
 *         ettl_append = ettl.append             # <<<<<<<<<<<<<<
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_ettl, __pyx_n_s_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ettl_append = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":794
 *         ettl = []
 *         ettl_append = ettl.append
 *         writer = self.writer             # <<<<<<<<<<<<<<
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_writer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":795
 *         ettl_append = ettl.append
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_writer != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":797
 *         if writer is not None: # self.is_started() inlined for speed
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl             # <<<<<<<<<<<<<<
 *             nkeys = []
 *             nkeys_append = nkeys.append
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_writer, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_wgetTtl = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":798
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl
 *             nkeys = []             # <<<<<<<<<<<<<<
 *             nkeys_append = nkeys.append
 *             for key in keys:
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_nkeys = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":799
 *             wgetTtl = writer.getTtl
 *             nkeys = []
 *             nkeys_append = nkeys.append             # <<<<<<<<<<<<<<
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_nkeys, __pyx_n_s_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_nkeys_append = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":800
 *             nkeys = []
 *             nkeys_append = nkeys.append
 *             for key in keys:             # <<<<<<<<<<<<<<
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:
 */
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 800, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 800, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 800, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "chorde/clients/async.py":801
 *             nkeys_append = nkeys.append
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)             # <<<<<<<<<<<<<<
 *                 if value is not _NONE:
 *                     value, ttl, _ = value
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wgetTtl);
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_wgetTtl; __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v__NONE};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v__NONE};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 801, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_cur_scope->__pyx_v_key);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v__NONE);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v__NONE);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_cur_scope->__pyx_v__NONE);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;

      /* "chorde/clients/async.py":802
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:             # <<<<<<<<<<<<<<
 *                     value, ttl, _ = value
 *                     if value is _DELETE or value is _EXPIRE:
 */
      __pyx_t_3 = (__pyx_cur_scope->__pyx_v_value != __pyx_cur_scope->__pyx_v__NONE);
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "chorde/clients/async.py":803
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:
 *                     value, ttl, _ = value             # <<<<<<<<<<<<<<
 *                     if value is _DELETE or value is _EXPIRE:
 *                         # Deletion/expiration means a miss...
 */
        if ((likely(PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_value))) || (PyList_CheckExact(__pyx_cur_scope->__pyx_v_value))) {
          PyObject* sequence = __pyx_cur_scope->__pyx_v_value;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 803, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 803, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 803, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 803, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          Py_ssize_t index = -1;
          __pyx_t_8 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 803, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_7);
          index = 2; __pyx_t_10 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 3) < 0) __PYX_ERR(0, 803, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L9_unpacking_done;
          __pyx_L8_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 803, __pyx_L1_error)
          __pyx_L9_unpacking_done:;
        }
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_value);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ttl);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ttl, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;

        /* "chorde/clients/async.py":804
 *                 if value is not _NONE:
 *                     value, ttl, _ = value
 *                     if value is _DELETE or value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                         # Deletion/expiration means a miss...
 *                         yield key, default
 */
        __pyx_t_3 = (__pyx_cur_scope->__pyx_v_value == __pyx_cur_scope->__pyx_v__DELETE);
        __pyx_t_12 = (__pyx_t_3 != 0);
        if (!__pyx_t_12) {
        } else {
          __pyx_t_2 = __pyx_t_12;
          goto __pyx_L11_bool_binop_done;
        }
        __pyx_t_12 = (__pyx_cur_scope->__pyx_v_value == __pyx_cur_scope->__pyx_v__EXPIRE);
        __pyx_t_3 = (__pyx_t_12 != 0);
        __pyx_t_2 = __pyx_t_3;
        __pyx_L11_bool_binop_done:;
        if (__pyx_t_2) {

          /* "chorde/clients/async.py":806
 *                     if value is _DELETE or value is _EXPIRE:
 *                         # Deletion/expiration means a miss...
 *                         yield key, default             # <<<<<<<<<<<<<<
 *                         continue
 *                     elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):
 */
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 806, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_key);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_default);
          __pyx_r = __pyx_t_10;
          __pyx_t_10 = 0;
          __Pyx_XGIVEREF(__pyx_t_1);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, yielding value */
          __pyx_generator->resume_label = 1;
          return __pyx_r;
          __pyx_L13_resume_from_yield:;
          __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 806, __pyx_L1_error)

          /* "chorde/clients/async.py":807
 *                         # Deletion/expiration means a miss...
 *                         yield key, default
 *                         continue             # <<<<<<<<<<<<<<
 *                     elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):
 *                         if ttl_skip is not None:
 */
          goto __pyx_L5_continue;

          /* "chorde/clients/async.py":804
 *                 if value is not _NONE:
 *                     value, ttl, _ = value
 *                     if value is _DELETE or value is _EXPIRE:             # <<<<<<<<<<<<<<
 *                         # Deletion/expiration means a miss...
 *                         yield key, default
 */
        }

        /* "chorde/clients/async.py":808
 *                         yield key, default
 *                         continue
 *                     elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):             # <<<<<<<<<<<<<<
 *                         if ttl_skip is not None:
 *                             # We'll do these without ttl_skip
 */
        __pyx_t_3 = (__pyx_cur_scope->__pyx_v_value == __pyx_cur_scope->__pyx_v__RENEW);
        __pyx_t_12 = (__pyx_t_3 != 0);
        if (__pyx_t_12) {
        } else {
          __pyx_t_2 = __pyx_t_12;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_12 = (__pyx_cur_scope->__pyx_v_ttl_skip == Py_None);
        __pyx_t_3 = (__pyx_t_12 != 0);
        if (!__pyx_t_3) {
        } else {
          __pyx_t_2 = __pyx_t_3;
          goto __pyx_L14_bool_binop_done;
        }
        __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_ttl, __pyx_cur_scope->__pyx_v_ttl_skip, Py_GE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 808, __pyx_L1_error)
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_2 = __pyx_t_3;
        __pyx_L14_bool_binop_done:;
        if (__pyx_t_2) {

          /* "chorde/clients/async.py":809
 *                         continue
 *                     elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):
 *                         if ttl_skip is not None:             # <<<<<<<<<<<<<<
 *                             # We'll do these without ttl_skip
 *                             ettl_append(key)
 */
          __pyx_t_2 = (__pyx_cur_scope->__pyx_v_ttl_skip != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {

            /* "chorde/clients/async.py":811
 *                         if ttl_skip is not None:
 *                             # We'll do these without ttl_skip
 *                             ettl_append(key)             # <<<<<<<<<<<<<<
 *                             continue
 *                     elif not hasattr(value, 'undefer'):
 */
            __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_ettl, __pyx_cur_scope->__pyx_v_key); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 811, __pyx_L1_error)

            /* "chorde/clients/async.py":812
 *                             # We'll do these without ttl_skip
 *                             ettl_append(key)
 *                             continue             # <<<<<<<<<<<<<<
 *                     elif not hasattr(value, 'undefer'):
 *                         yield key, value
 */
            goto __pyx_L5_continue;

            /* "chorde/clients/async.py":809
 *                         continue
 *                     elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):
 *                         if ttl_skip is not None:             # <<<<<<<<<<<<<<
 *                             # We'll do these without ttl_skip
 *                             ettl_append(key)
 */
          }

          /* "chorde/clients/async.py":808
 *                         yield key, default
 *                         continue
 *                     elif value is _RENEW and (ttl_skip is None or ttl >= ttl_skip):             # <<<<<<<<<<<<<<
 *                         if ttl_skip is not None:
 *                             # We'll do these without ttl_skip
 */
          goto __pyx_L10;
        }

        /* "chorde/clients/async.py":813
 *                             ettl_append(key)
 *                             continue
 *                     elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                         yield key, value
 *                         continue
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hasattr);
        __pyx_t_7 = __pyx_cur_scope->__pyx_v_hasattr; __pyx_t_6 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_value, __pyx_n_s_undefer};
          __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_value, __pyx_n_s_undefer};
          __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_10);
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 813, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_cur_scope->__pyx_v_value);
          __Pyx_INCREF(__pyx_n_s_undefer);
          __Pyx_GIVEREF(__pyx_n_s_undefer);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_n_s_undefer);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_2 = ((!__pyx_t_3) != 0);
        if (__pyx_t_2) {

          /* "chorde/clients/async.py":814
 *                             continue
 *                     elif not hasattr(value, 'undefer'):
 *                         yield key, value             # <<<<<<<<<<<<<<
 *                         continue
 *                 # Yep, _NONE when querying the writer, because we don't want
 */
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_key);
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
          __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_value);
          __pyx_r = __pyx_t_10;
          __pyx_t_10 = 0;
          __Pyx_XGIVEREF(__pyx_t_1);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, yielding value */
          __pyx_generator->resume_label = 2;
          return __pyx_r;
          __pyx_L18_resume_from_yield:;
          __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 814, __pyx_L1_error)

          /* "chorde/clients/async.py":815
 *                     elif not hasattr(value, 'undefer'):
 *                         yield key, value
 *                         continue             # <<<<<<<<<<<<<<
 *                 # Yep, _NONE when querying the writer, because we don't want
 *                 # to return a default if the writer doesn't have it, we must
 */
          goto __pyx_L5_continue;

          /* "chorde/clients/async.py":813
 *                             ettl_append(key)
 *                             continue
 *                     elif not hasattr(value, 'undefer'):             # <<<<<<<<<<<<<<
 *                         yield key, value
 *                         continue
 */
        }
        __pyx_L10:;

        /* "chorde/clients/async.py":802
 *             for key in keys:
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:             # <<<<<<<<<<<<<<
 *                     value, ttl, _ = value
 *                     if value is _DELETE or value is _EXPIRE:
 */
      }

      /* "chorde/clients/async.py":819
 *                 # to return a default if the writer doesn't have it, we must
 *                 # still check the client.
 *                 nkeys_append(key)             # <<<<<<<<<<<<<<
 *             keys = nkeys
 *             del nkeys, nkeys_append
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nkeys_append);
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_nkeys_append; __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_cur_scope->__pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_cur_scope->__pyx_v_key);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "chorde/clients/async.py":800
 *             nkeys = []
 *             nkeys_append = nkeys.append
 *             for key in keys:             # <<<<<<<<<<<<<<
 *                 value = wgetTtl(key, _NONE)
 *                 if value is not _NONE:
 */
      __pyx_L5_continue:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":820
 *                 # still check the client.
 *                 nkeys_append(key)
 *             keys = nkeys             # <<<<<<<<<<<<<<
 *             del nkeys, nkeys_append
 * 
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_nkeys);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_keys);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_keys, __pyx_cur_scope->__pyx_v_nkeys);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_nkeys);

    /* "chorde/clients/async.py":821
 *                 nkeys_append(key)
 *             keys = nkeys
 *             del nkeys, nkeys_append             # <<<<<<<<<<<<<<
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 */
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_nkeys);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_nkeys);
    __pyx_cur_scope->__pyx_v_nkeys = NULL;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_nkeys_append);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_nkeys_append);
    __pyx_cur_scope->__pyx_v_nkeys_append = NULL;

    /* "chorde/clients/async.py":824
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 for key in keys:
 *                     yield key, default
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_writer, __pyx_n_s_contains_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_cur_scope->__pyx_v__CLEAR) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_cur_scope->__pyx_v__CLEAR);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":825
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):
 *                 for key in keys:             # <<<<<<<<<<<<<<
 *                     yield key, default
 *                 for key in ettl:
 */
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_keys)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_keys)) {
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
        __pyx_t_5 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_5)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 825, __pyx_L1_error)
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          } else {
            if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 825, __pyx_L1_error)
            #else
            __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 825, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          }
        } else {
          __pyx_t_10 = __pyx_t_5(__pyx_t_1);
          if (unlikely(!__pyx_t_10)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 825, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;

        /* "chorde/clients/async.py":826
 *             if writer._contains(_CLEAR):
 *                 for key in keys:
 *                     yield key, default             # <<<<<<<<<<<<<<
 *                 for key in ettl:
 *                     yield key, default
 */
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_key);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_default);
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L22_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
        __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 826, __pyx_L1_error)

        /* "chorde/clients/async.py":825
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):
 *                 for key in keys:             # <<<<<<<<<<<<<<
 *                     yield key, default
 *                 for key in ettl:
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":827
 *                 for key in keys:
 *                     yield key, default
 *                 for key in ettl:             # <<<<<<<<<<<<<<
 *                     yield key, default
 *                 return
 */
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_ettl; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      for (;;) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 827, __pyx_L1_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;

        /* "chorde/clients/async.py":828
 *                     yield key, default
 *                 for key in ettl:
 *                     yield key, default             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_key);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_default);
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 4;
        return __pyx_r;
        __pyx_L25_resume_from_yield:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 828, __pyx_L1_error)

        /* "chorde/clients/async.py":827
 *                 for key in keys:
 *                     yield key, default
 *                 for key in ettl:             # <<<<<<<<<<<<<<
 *                     yield key, default
 *                 return
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":829
 *                 for key in ettl:
 *                     yield key, default
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         # Ok, read the cache then
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = NULL;
      goto __pyx_L0;

      /* "chorde/clients/async.py":824
 * 
 *             # Check pending clear - after checking the queue for sorted semantics
 *             if writer._contains(_CLEAR):             # <<<<<<<<<<<<<<
 *                 for key in keys:
 *                     yield key, default
 */
    }

    /* "chorde/clients/async.py":795
 *         ettl_append = ettl.append
 *         writer = self.writer
 *         if writer is not None: # self.is_started() inlined for speed             # <<<<<<<<<<<<<<
 *             # Try to read pending writes as if they were on the cache
 *             wgetTtl = writer.getTtl
 */
  }

  /* "chorde/clients/async.py":832
 * 
 *         # Ok, read the cache then
 *         if ettl:             # <<<<<<<<<<<<<<
 *             for key, value in self.client.getMulti(keys, default, **kw):
 *                 yield key, value
 */
  __pyx_t_2 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_ettl) != 0);
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":833
 *         # Ok, read the cache then
 *         if ettl:
 *             for key, value in self.client.getMulti(keys, default, **kw):             # <<<<<<<<<<<<<<
 *                 yield key, value
 *         if keys:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getMulti); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_keys);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_default);
    __pyx_t_7 = PyDict_Copy(__pyx_cur_scope->__pyx_v_kw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 833, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 833, __pyx_L1_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 833, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_5(__pyx_t_7);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 833, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 833, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L29_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L29_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 833, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L30_unpacking_done;
        __pyx_L29_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 833, __pyx_L1_error)
        __pyx_L30_unpacking_done:;
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;

      /* "chorde/clients/async.py":834
 *         if ettl:
 *             for key, value in self.client.getMulti(keys, default, **kw):
 *                 yield key, value             # <<<<<<<<<<<<<<
 *         if keys:
 *             for key, value in self.client.getMulti(keys, default, ttl_skip = ttl_skip, **kw):
 */
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_key);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_cur_scope->__pyx_v_value);
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
      __Pyx_XGIVEREF(__pyx_t_7);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 5;
      return __pyx_r;
      __pyx_L31_resume_from_yield:;
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_7);
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 834, __pyx_L1_error)

      /* "chorde/clients/async.py":833
 *         # Ok, read the cache then
 *         if ettl:
 *             for key, value in self.client.getMulti(keys, default, **kw):             # <<<<<<<<<<<<<<
 *                 yield key, value
 *         if keys:
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "chorde/clients/async.py":832
 * 
 *         # Ok, read the cache then
 *         if ettl:             # <<<<<<<<<<<<<<
 *             for key, value in self.client.getMulti(keys, default, **kw):
 *                 yield key, value
 */
  }

  /* "chorde/clients/async.py":835
 *             for key, value in self.client.getMulti(keys, default, **kw):
 *                 yield key, value
 *         if keys:             # <<<<<<<<<<<<<<
 *             for key, value in self.client.getMulti(keys, default, ttl_skip = ttl_skip, **kw):
 *                 yield key, value
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_keys); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":836
 *                 yield key, value
 *         if keys:
 *             for key, value in self.client.getMulti(keys, default, ttl_skip = ttl_skip, **kw):             # <<<<<<<<<<<<<<
 *                 yield key, value
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getMulti); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keys);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keys);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_keys);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_default);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_default);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_default);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ttl_skip, __pyx_cur_scope->__pyx_v_ttl_skip) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_1;
    __pyx_t_1 = 0;
    if (__Pyx_MergeKeywords(__pyx_t_10, __pyx_cur_scope->__pyx_v_kw) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 836, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 836, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_5(__pyx_t_10);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 836, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 836, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L35_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L35_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L36_unpacking_done;
        __pyx_L35_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 836, __pyx_L1_error)
        __pyx_L36_unpacking_done:;
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;

      /* "chorde/clients/async.py":837
 *         if keys:
 *             for key, value in self.client.getMulti(keys, default, ttl_skip = ttl_skip, **kw):
 *                 yield key, value             # <<<<<<<<<<<<<<
 * 
 *     def promote(self, key, *p, **kw):
 */
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_key);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_value);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
      __Pyx_XGIVEREF(__pyx_t_10);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_10;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 6;
      return __pyx_r;
      __pyx_L37_resume_from_yield:;
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_10 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_10);
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 837, __pyx_L1_error)

      /* "chorde/clients/async.py":836
 *                 yield key, value
 *         if keys:
 *             for key, value in self.client.getMulti(keys, default, ttl_skip = ttl_skip, **kw):             # <<<<<<<<<<<<<<
 *                 yield key, value
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "chorde/clients/async.py":835
 *             for key, value in self.client.getMulti(keys, default, **kw):
 *                 yield key, value
 *         if keys:             # <<<<<<<<<<<<<<
 *             for key, value in self.client.getMulti(keys, default, ttl_skip = ttl_skip, **kw):
 *                 yield key, value
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "chorde/clients/async.py":787
 *             yield key, (value, ttl)
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("getMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":839
 *                 yield key, value
 * 
 *     def promote(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             return
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_39promote(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_39promote = {"promote", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_39promote, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_39promote(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("promote (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_p = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_p)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_p);
  } else {
    __pyx_v_p = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("promote", 0, 2, 2, 1); __PYX_ERR(0, 839, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "promote") < 0)) __PYX_ERR(0, 839, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("promote", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 839, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_p); __pyx_v_p = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.promote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_38promote(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_p, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_38promote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_p, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("promote", 0);

  /* "chorde/clients/async.py":840
 * 
 *     def promote(self, key, *p, **kw):
 *         if self.is_started() and self.writer.contains(key):             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_started); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 840, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":841
 *     def promote(self, key, *p, **kw):
 *         if self.is_started() and self.writer.contains(key):
 *             return             # <<<<<<<<<<<<<<
 *         else:
 *             return self.client.promote(key, *p, **kw)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "chorde/clients/async.py":840
 * 
 *     def promote(self, key, *p, **kw):
 *         if self.is_started() and self.writer.contains(key):             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
  }

  /* "chorde/clients/async.py":843
 *             return
 *         else:
 *             return self.client.promote(key, *p, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def wait(self, key, timeout = None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_promote); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":839
 *                 yield key, value
 * 
 *     def promote(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             return
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.promote", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":845
 *             return self.client.promote(key, *p, **kw)
 * 
 *     def wait(self, key, timeout = None):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             self.writer.waitkey(key, timeout)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_41wait(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_41wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_41wait, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_41wait(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_timeout,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wait", 0, 2, 3, 1); __PYX_ERR(0, 845, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 845, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_timeout = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wait", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 845, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_40wait(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_timeout);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_40wait(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait", 0);

  /* "chorde/clients/async.py":846
 * 
 *     def wait(self, key, timeout = None):
 *         if self.is_started() and self.writer.contains(key):             # <<<<<<<<<<<<<<
 *             self.writer.waitkey(key, timeout)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_started); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":847
 *     def wait(self, key, timeout = None):
 *         if self.is_started() and self.writer.contains(key):
 *             self.writer.waitkey(key, timeout)             # <<<<<<<<<<<<<<
 * 
 *     def contains(self, key, ttl = None, **kw):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_waitkey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_timeout};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_timeout};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
      __Pyx_INCREF(__pyx_v_timeout);
      __Pyx_GIVEREF(__pyx_v_timeout);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_timeout);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "chorde/clients/async.py":846
 * 
 *     def wait(self, key, timeout = None):
 *         if self.is_started() and self.writer.contains(key):             # <<<<<<<<<<<<<<
 *             self.writer.waitkey(key, timeout)
 * 
 */
  }

  /* "chorde/clients/async.py":845
 *             return self.client.promote(key, *p, **kw)
 * 
 *     def wait(self, key, timeout = None):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             self.writer.waitkey(key, timeout)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":849
 *             self.writer.waitkey(key, timeout)
 * 
 *     def contains(self, key, ttl = None, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             if self.writer.contains(key):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_43contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_43contains = {"contains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_43contains, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_43contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contains (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ttl,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("contains", 0, 2, 3, 1); __PYX_ERR(0, 849, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "contains") < 0)) __PYX_ERR(0, 849, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_ttl = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contains", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 849, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_42contains(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_42contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contains", 0);

  /* "chorde/clients/async.py":850
 * 
 *     def contains(self, key, ttl = None, **kw):
 *         if self.is_started():             # <<<<<<<<<<<<<<
 *             if self.writer.contains(key):
 *                 return True
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "chorde/clients/async.py":851
 *     def contains(self, key, ttl = None, **kw):
 *         if self.is_started():
 *             if self.writer.contains(key):             # <<<<<<<<<<<<<<
 *                 return True
 *             else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":852
 *         if self.is_started():
 *             if self.writer.contains(key):
 *                 return True             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.client.contains(key, ttl, **kw)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L0;

      /* "chorde/clients/async.py":851
 *     def contains(self, key, ttl = None, **kw):
 *         if self.is_started():
 *             if self.writer.contains(key):             # <<<<<<<<<<<<<<
 *                 return True
 *             else:
 */
    }

    /* "chorde/clients/async.py":854
 *                 return True
 *             else:
 *                 return self.client.contains(key, ttl, **kw)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.client.contains(key, ttl, **kw)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
      __Pyx_INCREF(__pyx_v_ttl);
      __Pyx_GIVEREF(__pyx_v_ttl);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ttl);
      __pyx_t_2 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "chorde/clients/async.py":850
 * 
 *     def contains(self, key, ttl = None, **kw):
 *         if self.is_started():             # <<<<<<<<<<<<<<
 *             if self.writer.contains(key):
 *                 return True
 */
  }

  /* "chorde/clients/async.py":856
 *                 return self.client.contains(key, ttl, **kw)
 *         else:
 *             return self.client.contains(key, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_ttl);
    __Pyx_GIVEREF(__pyx_v_ttl);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ttl);
    __pyx_t_1 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":849
 *             self.writer.waitkey(key, timeout)
 * 
 *     def contains(self, key, ttl = None, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             if self.writer.contains(key):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":859
 * 
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_45register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_21AsyncWriteCacheClient_44register_cleanup[] = "\n        Register a callable that will take no arguments, and will\n        be invoked every cleanup_cycles tasks in order to perform\n        thread-local cleanup for this writer.\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_45register_cleanup = {"register_cleanup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_45register_cleanup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_21AsyncWriteCacheClient_44register_cleanup};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_45register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_task = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_cleanup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_task,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_task)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, 1); __PYX_ERR(0, 859, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_cleanup") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_task = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_44register_cleanup(__pyx_self, __pyx_v_self, __pyx_v_task);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_44register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_cleanup", 0);

  /* "chorde/clients/async.py":865
 *         thread-local cleanup for this writer.
 *         """
 *         self.writer.register_cleanup(task)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_cleanup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_task) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_task);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":859
 * 
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":867
 *         self.writer.register_cleanup(task)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_47__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_47__str__ = {"__str__", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_47__str__, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_47__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_46__str__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_46__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "chorde/clients/async.py":868
 * 
 *     def __str__(self):
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_of_r, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":867
 *         self.writer.register_cleanup(task)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":870
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_49__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_49__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_49__repr__, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21AsyncWriteCacheClient_49__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_48__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21AsyncWriteCacheClient_48__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "chorde/clients/async.py":871
 * 
 *     def __repr__(self):
 *         return str(self)             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":870
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncWriteCacheClient.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":885
 *         __slots__ = ('value',)
 * 
 *         def __init__(self, value):             # <<<<<<<<<<<<<<
 *             self.value = value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_16ExceptionWrapper_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_16ExceptionWrapper_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_16ExceptionWrapper_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_16ExceptionWrapper_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 885, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 885, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 885, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.ExceptionWrapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_16ExceptionWrapper___init__(__pyx_self, __pyx_v_self, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_16ExceptionWrapper___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":886
 * 
 *         def __init__(self, value):
 *             self.value = value             # <<<<<<<<<<<<<<
 * 
 *         def reraise(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_v_value) < 0) __PYX_ERR(0, 886, __pyx_L1_error)

  /* "chorde/clients/async.py":885
 *         __slots__ = ('value',)
 * 
 *         def __init__(self, value):             # <<<<<<<<<<<<<<
 *             self.value = value
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.ExceptionWrapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":888
 *             self.value = value
 * 
 *         def reraise(self):             # <<<<<<<<<<<<<<
 *             exc = self.value
 *             del self.value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_16ExceptionWrapper_3reraise(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_16ExceptionWrapper_3reraise = {"reraise", (PyCFunction)__pyx_pw_6chorde_7clients_5async_16ExceptionWrapper_3reraise, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_16ExceptionWrapper_3reraise(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reraise (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_16ExceptionWrapper_2reraise(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_16ExceptionWrapper_2reraise(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reraise", 0);

  /* "chorde/clients/async.py":889
 * 
 *         def reraise(self):
 *             exc = self.value             # <<<<<<<<<<<<<<
 *             del self.value
 *             raise exc[0], exc[1], exc[2]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_exc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":890
 *         def reraise(self):
 *             exc = self.value
 *             del self.value             # <<<<<<<<<<<<<<
 *             raise exc[0], exc[1], exc[2]
 * 
 */
  if (__Pyx_PyObject_DelAttrStr(__pyx_v_self, __pyx_n_s_value) < 0) __PYX_ERR(0, 890, __pyx_L1_error)

  /* "chorde/clients/async.py":891
 *             exc = self.value
 *             del self.value
 *             raise exc[0], exc[1], exc[2]             # <<<<<<<<<<<<<<
 * 
 *     class Future(object):  # lint:ok
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_exc, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_Raise(__pyx_t_1, __pyx_t_2, __pyx_t_3, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 891, __pyx_L1_error)

  /* "chorde/clients/async.py":888
 *             self.value = value
 * 
 *         def reraise(self):             # <<<<<<<<<<<<<<
 *             exc = self.value
 *             del self.value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.ExceptionWrapper.reraise", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":899
 *         )
 * 
 *         def __init__(self, logger = None):             # <<<<<<<<<<<<<<
 *             self._cb = []
 *             self._logger = logger
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_logger = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_logger,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_logger);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 899, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_logger = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 899, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future___init__(__pyx_self, __pyx_v_self, __pyx_v_logger);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_logger) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":900
 * 
 *         def __init__(self, logger = None):
 *             self._cb = []             # <<<<<<<<<<<<<<
 *             self._logger = logger
 *             self._lock = threading.Lock()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cb, __pyx_t_1) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":901
 *         def __init__(self, logger = None):
 *             self._cb = []
 *             self._logger = logger             # <<<<<<<<<<<<<<
 *             self._lock = threading.Lock()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_logger_2, __pyx_v_logger) < 0) __PYX_ERR(0, 901, __pyx_L1_error)

  /* "chorde/clients/async.py":902
 *             self._cb = []
 *             self._logger = logger
 *             self._lock = threading.Lock()             # <<<<<<<<<<<<<<
 * 
 *         def _set_nothreads(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lock, __pyx_t_1) < 0) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":899
 *         )
 * 
 *         def __init__(self, logger = None):             # <<<<<<<<<<<<<<
 *             self._cb = []
 *             self._logger = logger
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":904
 *             self._lock = threading.Lock()
 * 
 *         def _set_nothreads(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Like set(), but assuming no threading is involved. It won't wake waiting threads,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_20__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_tuple);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_tuple);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_tuple);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_3_set_nothreads(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_2_set_nothreads[] = "\n            Like set(), but assuming no threading is involved. It won't wake waiting threads,\n            nor will it try to be thread-safe. Safe to call when the calling\n            thread is the only one owning references to this future, and much faster.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_3_set_nothreads = {"_set_nothreads", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_3_set_nothreads, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_2_set_nothreads};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_3_set_nothreads(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_hasattr = 0;
  CYTHON_UNUSED PyObject *__pyx_v_tuple = 0;
  CYTHON_UNUSED PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_nothreads (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_hasattr,&__pyx_n_s_tuple,&__pyx_n_s_getattr,0};
    PyObject* values[5] = {0,0,0,0,0};
    __pyx_defaults7 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_hasattr;
    values[3] = __pyx_dynamic_args->__pyx_arg_tuple;
    values[4] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_nothreads", 0, 2, 5, 1); __PYX_ERR(0, 904, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tuple);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_nothreads") < 0)) __PYX_ERR(0, 904, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
    __pyx_v_hasattr = values[2];
    __pyx_v_tuple = values[3];
    __pyx_v_getattr = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_nothreads", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 904, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future._set_nothreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_2_set_nothreads(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_hasattr, __pyx_v_tuple, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_2_set_nothreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_hasattr, CYTHON_UNUSED PyObject *__pyx_v_tuple, CYTHON_UNUSED PyObject *__pyx_v_getattr) {
  PyObject *__pyx_v_cbs = NULL;
  PyObject *__pyx_v_cb = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_nothreads", 0);

  /* "chorde/clients/async.py":910
 *             thread is the only one owning references to this future, and much faster.
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 # No setting twice
 *                 return
 */
  __Pyx_INCREF(__pyx_v_hasattr);
  __pyx_t_2 = __pyx_v_hasattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_value_2);
    __Pyx_GIVEREF(__pyx_n_s_value_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_value_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":912
 *             if hasattr(self, '_value'):
 *                 # No setting twice
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             self._value = value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "chorde/clients/async.py":910
 *             thread is the only one owning references to this future, and much faster.
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 # No setting twice
 *                 return
 */
  }

  /* "chorde/clients/async.py":914
 *                 return
 * 
 *             self._value = value             # <<<<<<<<<<<<<<
 *             self._running = False
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value_2, __pyx_v_value) < 0) __PYX_ERR(0, 914, __pyx_L1_error)

  /* "chorde/clients/async.py":915
 * 
 *             self._value = value
 *             self._running = False             # <<<<<<<<<<<<<<
 * 
 *             if self._cb:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_running, Py_False) < 0) __PYX_ERR(0, 915, __pyx_L1_error)

  /* "chorde/clients/async.py":917
 *             self._running = False
 * 
 *             if self._cb:             # <<<<<<<<<<<<<<
 *                 cbs = list(self._cb)
 *                 del self._cb[:len(cbs)]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":918
 * 
 *             if self._cb:
 *                 cbs = list(self._cb)             # <<<<<<<<<<<<<<
 *                 del self._cb[:len(cbs)]
 *                 for cb in cbs:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cbs = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "chorde/clients/async.py":919
 *             if self._cb:
 *                 cbs = list(self._cb)
 *                 del self._cb[:len(cbs)]             # <<<<<<<<<<<<<<
 *                 for cb in cbs:
 *                     try:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cb); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyList_GET_SIZE(__pyx_v_cbs); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 919, __pyx_L1_error)
    if (__Pyx_PyObject_DelSlice(__pyx_t_2, 0, __pyx_t_7, NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "chorde/clients/async.py":920
 *                 cbs = list(self._cb)
 *                 del self._cb[:len(cbs)]
 *                 for cb in cbs:             # <<<<<<<<<<<<<<
 *                     try:
 *                         cb(value)
 */
    __pyx_t_2 = __pyx_v_cbs; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    for (;;) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 920, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_cb, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "chorde/clients/async.py":921
 *                 del self._cb[:len(cbs)]
 *                 for cb in cbs:
 *                     try:             # <<<<<<<<<<<<<<
 *                         cb(value)
 *                     except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "chorde/clients/async.py":922
 *                 for cb in cbs:
 *                     try:
 *                         cb(value)             # <<<<<<<<<<<<<<
 *                     except:
 *                         if self._logger is not None:
 */
          __Pyx_INCREF(__pyx_v_cb);
          __pyx_t_5 = __pyx_v_cb; __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "chorde/clients/async.py":921
 *                 del self._cb[:len(cbs)]
 *                 for cb in cbs:
 *                     try:             # <<<<<<<<<<<<<<
 *                         cb(value)
 *                     except:
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "chorde/clients/async.py":923
 *                     try:
 *                         cb(value)
 *                     except:             # <<<<<<<<<<<<<<
 *                         if self._logger is not None:
 *                             error = self._logger
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.Future._set_nothreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_3) < 0) __PYX_ERR(0, 923, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_3);

          /* "chorde/clients/async.py":924
 *                         cb(value)
 *                     except:
 *                         if self._logger is not None:             # <<<<<<<<<<<<<<
 *                             error = self._logger
 *                         else:
 */
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 924, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_6 = (__pyx_t_11 != Py_None);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = (__pyx_t_6 != 0);
          if (__pyx_t_12) {

            /* "chorde/clients/async.py":925
 *                     except:
 *                         if self._logger is not None:
 *                             error = self._logger             # <<<<<<<<<<<<<<
 *                         else:
 *                             error = logging.error
 */
            __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 925, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_11);
            __pyx_t_11 = 0;

            /* "chorde/clients/async.py":924
 *                         cb(value)
 *                     except:
 *                         if self._logger is not None:             # <<<<<<<<<<<<<<
 *                             error = self._logger
 *                         else:
 */
            goto __pyx_L17;
          }

          /* "chorde/clients/async.py":927
 *                             error = self._logger
 *                         else:
 *                             error = logging.error             # <<<<<<<<<<<<<<
 *                         error("Error in async callback", exc_info = True)
 * 
 */
          /*else*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logging); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 927, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_error); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 927, __pyx_L9_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_13);
            __pyx_t_13 = 0;
          }
          __pyx_L17:;

          /* "chorde/clients/async.py":928
 *                         else:
 *                             error = logging.error
 *                         error("Error in async callback", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *         def set(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):
 */
          __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 928, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 928, __pyx_L9_except_error)
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_tuple__11, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 928, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;

        /* "chorde/clients/async.py":921
 *                 del self._cb[:len(cbs)]
 *                 for cb in cbs:
 *                     try:             # <<<<<<<<<<<<<<
 *                         cb(value)
 *                     except:
 */
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }

      /* "chorde/clients/async.py":920
 *                 cbs = list(self._cb)
 *                 del self._cb[:len(cbs)]
 *                 for cb in cbs:             # <<<<<<<<<<<<<<
 *                     try:
 *                         cb(value)
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "chorde/clients/async.py":917
 *             self._running = False
 * 
 *             if self._cb:             # <<<<<<<<<<<<<<
 *                 cbs = list(self._cb)
 *                 del self._cb[:len(cbs)]
 */
  }

  /* "chorde/clients/async.py":904
 *             self._lock = threading.Lock()
 * 
 *         def _set_nothreads(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Like set(), but assuming no threading is involved. It won't wake waiting threads,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("chorde.clients.async.Future._set_nothreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbs);
  __Pyx_XDECREF(__pyx_v_cb);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":930
 *                         error("Error in async callback", exc_info = True)
 * 
 *         def set(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Set the future's result as either a value, an exception wrappedn in ExceptionWrapper, or
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_tuple);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_tuple);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_tuple);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_5set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_4set[] = "\n            Set the future's result as either a value, an exception wrappedn in ExceptionWrapper, or\n            a cache miss if given CacheMissError (the class itself)\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_5set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_5set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_4set};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_5set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_hasattr = 0;
  CYTHON_UNUSED PyObject *__pyx_v_tuple = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_hasattr,&__pyx_n_s_tuple,&__pyx_n_s_getattr,0};
    PyObject* values[5] = {0,0,0,0,0};
    __pyx_defaults8 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_hasattr;
    values[3] = __pyx_dynamic_args->__pyx_arg_tuple;
    values[4] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 0, 2, 5, 1); __PYX_ERR(0, 930, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tuple);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 930, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
    __pyx_v_hasattr = values[2];
    __pyx_v_tuple = values[3];
    __pyx_v_getattr = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 930, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_4set(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_hasattr, __pyx_v_tuple, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_4set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_hasattr, CYTHON_UNUSED PyObject *__pyx_v_tuple, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_v_old = NULL;
  PyObject *__pyx_v_cbs = NULL;
  PyObject *__pyx_v_cb = NULL;
  PyObject *__pyx_v_error = NULL;
  PyObject *__pyx_v_event = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 0);

  /* "chorde/clients/async.py":935
 *             a cache miss if given CacheMissError (the class itself)
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 # No setting twice
 *                 return
 */
  __Pyx_INCREF(__pyx_v_hasattr);
  __pyx_t_2 = __pyx_v_hasattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_value_2);
    __Pyx_GIVEREF(__pyx_n_s_value_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_value_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":937
 *             if hasattr(self, '_value'):
 *                 # No setting twice
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             with self._lock:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "chorde/clients/async.py":935
 *             a cache miss if given CacheMissError (the class itself)
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 # No setting twice
 *                 return
 */
  }

  /* "chorde/clients/async.py":939
 *                 return
 * 
 *             with self._lock:             # <<<<<<<<<<<<<<
 *                 old = getattr(self, '_value', None) # avoid deadlocks due to finalizers
 *                 cbs = list(self._cb)
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "chorde/clients/async.py":940
 * 
 *             with self._lock:
 *                 old = getattr(self, '_value', None) # avoid deadlocks due to finalizers             # <<<<<<<<<<<<<<
 *                 cbs = list(self._cb)
 *                 self._value = value
 */
          __Pyx_INCREF(__pyx_v_getattr);
          __pyx_t_2 = __pyx_v_getattr; __pyx_t_5 = NULL;
          __pyx_t_4 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_4 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self, __pyx_n_s_value_2, Py_None};
            __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L8_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self, __pyx_n_s_value_2, Py_None};
            __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L8_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else
          #endif
          {
            __pyx_t_3 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 940, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
            }
            __Pyx_INCREF(__pyx_v_self);
            __Pyx_GIVEREF(__pyx_v_self);
            PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_self);
            __Pyx_INCREF(__pyx_n_s_value_2);
            __Pyx_GIVEREF(__pyx_n_s_value_2);
            PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_value_2);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_4, Py_None);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_old = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "chorde/clients/async.py":941
 *             with self._lock:
 *                 old = getattr(self, '_value', None) # avoid deadlocks due to finalizers
 *                 cbs = list(self._cb)             # <<<<<<<<<<<<<<
 *                 self._value = value
 *             del old
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_cbs = ((PyObject*)__pyx_t_2);
          __pyx_t_2 = 0;

          /* "chorde/clients/async.py":942
 *                 old = getattr(self, '_value', None) # avoid deadlocks due to finalizers
 *                 cbs = list(self._cb)
 *                 self._value = value             # <<<<<<<<<<<<<<
 *             del old
 * 
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value_2, __pyx_v_value) < 0) __PYX_ERR(0, 942, __pyx_L8_error)

          /* "chorde/clients/async.py":939
 *                 return
 * 
 *             with self._lock:             # <<<<<<<<<<<<<<
 *                 old = getattr(self, '_value', None) # avoid deadlocks due to finalizers
 *                 cbs = list(self._cb)
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L13_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.Future.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 939, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 939, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_6 < 0) __PYX_ERR(0, 939, __pyx_L10_except_error)
          __pyx_t_12 = ((!(__pyx_t_6 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
            __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
            __PYX_ERR(0, 939, __pyx_L10_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L13_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple_, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 939, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    goto __pyx_L17;
    __pyx_L4_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L17:;
  }

  /* "chorde/clients/async.py":943
 *                 cbs = list(self._cb)
 *                 self._value = value
 *             del old             # <<<<<<<<<<<<<<
 * 
 *             for cb in cbs:
 */
  if (unlikely(!__pyx_v_old)) { __Pyx_RaiseUnboundLocalError("old"); __PYX_ERR(0, 943, __pyx_L1_error) }
  __Pyx_DECREF(__pyx_v_old);
  __pyx_v_old = NULL;

  /* "chorde/clients/async.py":945
 *             del old
 * 
 *             for cb in cbs:             # <<<<<<<<<<<<<<
 *                 try:
 *                     cb(value)
 */
  if (unlikely(!__pyx_v_cbs)) { __Pyx_RaiseUnboundLocalError("cbs"); __PYX_ERR(0, 945, __pyx_L1_error) }
  __pyx_t_3 = __pyx_v_cbs; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0;
  for (;;) {
    if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 945, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_cb, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":946
 * 
 *             for cb in cbs:
 *                 try:             # <<<<<<<<<<<<<<
 *                     cb(value)
 *                 except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "chorde/clients/async.py":947
 *             for cb in cbs:
 *                 try:
 *                     cb(value)             # <<<<<<<<<<<<<<
 *                 except:
 *                     if self._logger is not None:
 */
        __Pyx_INCREF(__pyx_v_cb);
        __pyx_t_2 = __pyx_v_cb; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "chorde/clients/async.py":946
 * 
 *             for cb in cbs:
 *                 try:             # <<<<<<<<<<<<<<
 *                     cb(value)
 *                 except:
 */
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L27_try_end;
      __pyx_L20_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "chorde/clients/async.py":948
 *                 try:
 *                     cb(value)
 *                 except:             # <<<<<<<<<<<<<<
 *                     if self._logger is not None:
 *                         error = self._logger
 */
      /*except:*/ {
        __Pyx_AddTraceback("chorde.clients.async.Future.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 948, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_5);

        /* "chorde/clients/async.py":949
 *                     cb(value)
 *                 except:
 *                     if self._logger is not None:             # <<<<<<<<<<<<<<
 *                         error = self._logger
 *                     else:
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 949, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_12 = (__pyx_t_14 != Py_None);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_6 = (__pyx_t_12 != 0);
        if (__pyx_t_6) {

          /* "chorde/clients/async.py":950
 *                 except:
 *                     if self._logger is not None:
 *                         error = self._logger             # <<<<<<<<<<<<<<
 *                     else:
 *                         error = logging.error
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 950, __pyx_L22_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_14);
          __pyx_t_14 = 0;

          /* "chorde/clients/async.py":949
 *                     cb(value)
 *                 except:
 *                     if self._logger is not None:             # <<<<<<<<<<<<<<
 *                         error = self._logger
 *                     else:
 */
          goto __pyx_L30;
        }

        /* "chorde/clients/async.py":952
 *                         error = self._logger
 *                     else:
 *                         error = logging.error             # <<<<<<<<<<<<<<
 *                     error("Error in async callback", exc_info = True)
 *             self._running = False
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logging); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 952, __pyx_L22_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_error); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 952, __pyx_L22_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF_SET(__pyx_v_error, __pyx_t_15);
          __pyx_t_15 = 0;
        }
        __pyx_L30:;

        /* "chorde/clients/async.py":953
 *                     else:
 *                         error = logging.error
 *                     error("Error in async callback", exc_info = True)             # <<<<<<<<<<<<<<
 *             self._running = False
 * 
 */
        __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 953, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 953, __pyx_L22_except_error)
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_tuple__11, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 953, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L21_exception_handled;
      }
      __pyx_L22_except_error:;

      /* "chorde/clients/async.py":946
 * 
 *             for cb in cbs:
 *                 try:             # <<<<<<<<<<<<<<
 *                     cb(value)
 *                 except:
 */
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_10, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L21_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_10, __pyx_t_9);
      __pyx_L27_try_end:;
    }

    /* "chorde/clients/async.py":945
 *             del old
 * 
 *             for cb in cbs:             # <<<<<<<<<<<<<<
 *                 try:
 *                     cb(value)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "chorde/clients/async.py":954
 *                         error = logging.error
 *                     error("Error in async callback", exc_info = True)
 *             self._running = False             # <<<<<<<<<<<<<<
 * 
 *             event = getattr(self, '_done_event', None)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_running, Py_False) < 0) __PYX_ERR(0, 954, __pyx_L1_error)

  /* "chorde/clients/async.py":956
 *             self._running = False
 * 
 *             event = getattr(self, '_done_event', None)             # <<<<<<<<<<<<<<
 *             if event is not None:
 *                 # wake up waiting threads
 */
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_5 = __pyx_v_getattr; __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_done_event_2, Py_None};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_done_event_2, Py_None};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_done_event_2);
    __Pyx_GIVEREF(__pyx_n_s_done_event_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_n_s_done_event_2);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_4, Py_None);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_event = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "chorde/clients/async.py":957
 * 
 *             event = getattr(self, '_done_event', None)
 *             if event is not None:             # <<<<<<<<<<<<<<
 *                 # wake up waiting threads
 *                 event.set()
 */
  __pyx_t_6 = (__pyx_v_event != Py_None);
  __pyx_t_12 = (__pyx_t_6 != 0);
  if (__pyx_t_12) {

    /* "chorde/clients/async.py":959
 *             if event is not None:
 *                 # wake up waiting threads
 *                 event.set()             # <<<<<<<<<<<<<<
 * 
 *         set_result = set
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "chorde/clients/async.py":957
 * 
 *             event = getattr(self, '_done_event', None)
 *             if event is not None:             # <<<<<<<<<<<<<<
 *                 # wake up waiting threads
 *                 event.set()
 */
  }

  /* "chorde/clients/async.py":930
 *                         error("Error in async callback", exc_info = True)
 * 
 *         def set(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Set the future's result as either a value, an exception wrappedn in ExceptionWrapper, or
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("chorde.clients.async.Future.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_old);
  __Pyx_XDECREF(__pyx_v_cbs);
  __Pyx_XDECREF(__pyx_v_cb);
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_XDECREF(__pyx_v_event);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":963
 *         set_result = set
 * 
 *         def miss(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_7miss(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_6miss[] = "\n            Shorthand for setting a cache miss result\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_7miss = {"miss", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_7miss, METH_O, __pyx_doc_6chorde_7clients_5async_6Future_6miss};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_7miss(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("miss (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_6miss(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_6miss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("miss", 0);

  /* "chorde/clients/async.py":967
 *             Shorthand for setting a cache miss result
 *             """
 *             self.set(CacheMissError)             # <<<<<<<<<<<<<<
 * 
 *         def _miss_nothreads(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":963
 *         set_result = set
 * 
 *         def miss(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.Future.miss", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":969
 *             self.set(CacheMissError)
 * 
 *         def _miss_nothreads(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result without thread safety.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_9_miss_nothreads(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_8_miss_nothreads[] = "\n            Shorthand for setting a cache miss result without thread safety.\n            See _set_nothreads\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_9_miss_nothreads = {"_miss_nothreads", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_9_miss_nothreads, METH_O, __pyx_doc_6chorde_7clients_5async_6Future_8_miss_nothreads};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_9_miss_nothreads(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_miss_nothreads (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_8_miss_nothreads(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_8_miss_nothreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_miss_nothreads", 0);

  /* "chorde/clients/async.py":974
 *             See _set_nothreads
 *             """
 *             self._set_nothreads(CacheMissError)             # <<<<<<<<<<<<<<
 * 
 *         def exc(self, exc_info):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_nothreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":969
 *             self.set(CacheMissError)
 * 
 *         def _miss_nothreads(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result without thread safety.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.Future._miss_nothreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":976
 *             self._set_nothreads(CacheMissError)
 * 
 *         def exc(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_11exc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_10exc[] = "\n            Shorthand for setting an exception result from an exc_info tuple\n            as returned by sys.exc_info()\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_11exc = {"exc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_11exc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_10exc};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_11exc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_exc_info = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exc_info,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("exc", 1, 2, 2, 1); __PYX_ERR(0, 976, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exc") < 0)) __PYX_ERR(0, 976, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_exc_info = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 976, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.exc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_10exc(__pyx_self, __pyx_v_self, __pyx_v_exc_info);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_10exc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exc_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exc", 0);

  /* "chorde/clients/async.py":981
 *             as returned by sys.exc_info()
 *             """
 *             self.set(ExceptionWrapper(exc_info))             # <<<<<<<<<<<<<<
 * 
 *         def _exc_nothreads(self, exc_info):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_exc_info) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":976
 *             self._set_nothreads(CacheMissError)
 * 
 *         def exc(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future.exc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":983
 *             self.set(ExceptionWrapper(exc_info))
 * 
 *         def _exc_nothreads(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_13_exc_nothreads(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_12_exc_nothreads[] = "\n            Shorthand for setting an exception result from an exc_info tuple\n            as returned by sys.exc_info(), without thread safety.\n            See _set_nothreads\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_13_exc_nothreads = {"_exc_nothreads", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_13_exc_nothreads, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_12_exc_nothreads};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_13_exc_nothreads(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_exc_info = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exc_nothreads (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exc_info,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exc_nothreads", 1, 2, 2, 1); __PYX_ERR(0, 983, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_exc_nothreads") < 0)) __PYX_ERR(0, 983, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_exc_info = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_exc_nothreads", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 983, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future._exc_nothreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_12_exc_nothreads(__pyx_self, __pyx_v_self, __pyx_v_exc_info);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_12_exc_nothreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exc_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_exc_nothreads", 0);

  /* "chorde/clients/async.py":989
 *             See _set_nothreads
 *             """
 *             self._set_nothreads(ExceptionWrapper(exc_info))             # <<<<<<<<<<<<<<
 * 
 *         def set_exception(self, exception):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_nothreads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_exc_info) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":983
 *             self.set(ExceptionWrapper(exc_info))
 * 
 *         def _exc_nothreads(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future._exc_nothreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":991
 *             self._set_nothreads(ExceptionWrapper(exc_info))
 * 
 *         def set_exception(self, exception):             # <<<<<<<<<<<<<<
 *             """
 *             Set the Future's exception object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_15set_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_14set_exception[] = "\n            Set the Future's exception object.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_15set_exception = {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_15set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_14set_exception};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_15set_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_exception = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_exception (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exception,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_exception", 1, 2, 2, 1); __PYX_ERR(0, 991, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_exception") < 0)) __PYX_ERR(0, 991, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_exception = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_exception", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 991, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_14set_exception(__pyx_self, __pyx_v_self, __pyx_v_exception);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_14set_exception(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exception) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_exception", 0);

  /* "chorde/clients/async.py":995
 *             Set the Future's exception object.
 *             """
 *             self.exc((type(exception),exception,None))             # <<<<<<<<<<<<<<
 * 
 *         def on_value(self, callback):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_exception)));
  __Pyx_INCREF(__pyx_v_exception);
  __Pyx_GIVEREF(__pyx_v_exception);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_exception);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":991
 *             self._set_nothreads(ExceptionWrapper(exc_info))
 * 
 *         def set_exception(self, exception):             # <<<<<<<<<<<<<<
 *             """
 *             Set the Future's exception object.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.Future.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":997
 *             self.exc((type(exception),exception,None))
 * 
 *         def on_value(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When and if the operation completes without exception, the callback
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_17on_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_16on_value[] = "\n            When and if the operation completes without exception, the callback\n            will be invoked with its result.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_17on_value = {"on_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_17on_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_16on_value};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_17on_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_value", 1, 2, 2, 1); __PYX_ERR(0, 997, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_value") < 0)) __PYX_ERR(0, 997, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 997, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.on_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_16on_value(__pyx_self, __pyx_v_self, __pyx_v_callback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1002
 *             will be invoked with its result.
 *             """
 *             def value_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):
 *                     return callback(value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_8on_value_1value_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_8on_value_1value_callback = {"value_callback", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_8on_value_1value_callback, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_8on_value_1value_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_8on_value_value_callback(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_8on_value_value_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value_callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1003
 *             """
 *             def value_callback(value):
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     return callback(value)
 *             return self._on_stuff(value_callback)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_v_value != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":1004
 *             def value_callback(value):
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):
 *                     return callback(value)             # <<<<<<<<<<<<<<
 *             return self._on_stuff(value_callback)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_callback)) { __Pyx_RaiseClosureNameError("callback"); __PYX_ERR(0, 1004, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_callback; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1003
 *             """
 *             def value_callback(value):
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     return callback(value)
 *             return self._on_stuff(value_callback)
 */
  }

  /* "chorde/clients/async.py":1002
 *             will be invoked with its result.
 *             """
 *             def value_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):
 *                     return callback(value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_value.value_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":997
 *             self.exc((type(exception),exception,None))
 * 
 *         def on_value(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When and if the operation completes without exception, the callback
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_16on_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *__pyx_cur_scope;
  PyObject *__pyx_v_value_callback = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_value", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_2_on_value(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_2_on_value, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 997, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_callback = __pyx_v_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_callback);

  /* "chorde/clients/async.py":1002
 *             will be invoked with its result.
 *             """
 *             def value_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):
 *                     return callback(value)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_8on_value_1value_callback, 0, __pyx_n_s_Future_on_value_locals_value_cal, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value_callback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1005
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):
 *                     return callback(value)
 *             return self._on_stuff(value_callback)             # <<<<<<<<<<<<<<
 * 
 *         def on_miss(self, callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value_callback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":997
 *             self.exc((type(exception),exception,None))
 * 
 *         def on_value(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When and if the operation completes without exception, the callback
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value_callback);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1007
 *             return self._on_stuff(value_callback)
 * 
 *         def on_miss(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in a cache miss, the callback will be invoked
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_19on_miss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_18on_miss[] = "\n            If the operation results in a cache miss, the callback will be invoked\n            without arugments.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_19on_miss = {"on_miss", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_19on_miss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_18on_miss};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_19on_miss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_miss (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_miss", 1, 2, 2, 1); __PYX_ERR(0, 1007, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_miss") < 0)) __PYX_ERR(0, 1007, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_miss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1007, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.on_miss", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_18on_miss(__pyx_self, __pyx_v_self, __pyx_v_callback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1012
 *             without arugments.
 *             """
 *             def miss_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     return callback()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_7on_miss_1miss_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_7on_miss_1miss_callback = {"miss_callback", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_7on_miss_1miss_callback, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_7on_miss_1miss_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("miss_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_7on_miss_miss_callback(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_7on_miss_miss_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("miss_callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1013
 *             """
 *             def miss_callback(value):
 *                 if value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     return callback()
 *             return self._on_stuff(miss_callback)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_value == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1014
 *             def miss_callback(value):
 *                 if value is CacheMissError:
 *                     return callback()             # <<<<<<<<<<<<<<
 *             return self._on_stuff(miss_callback)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_callback)) { __Pyx_RaiseClosureNameError("callback"); __PYX_ERR(0, 1014, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_callback; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1013
 *             """
 *             def miss_callback(value):
 *                 if value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     return callback()
 *             return self._on_stuff(miss_callback)
 */
  }

  /* "chorde/clients/async.py":1012
 *             without arugments.
 *             """
 *             def miss_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     return callback()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_miss.miss_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1007
 *             return self._on_stuff(value_callback)
 * 
 *         def on_miss(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in a cache miss, the callback will be invoked
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_18on_miss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *__pyx_cur_scope;
  PyObject *__pyx_v_miss_callback = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_miss", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_3_on_miss(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_3_on_miss, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1007, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_callback = __pyx_v_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_callback);

  /* "chorde/clients/async.py":1012
 *             without arugments.
 *             """
 *             def miss_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     return callback()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_7on_miss_1miss_callback, 0, __pyx_n_s_Future_on_miss_locals_miss_callb, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_miss_callback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1015
 *                 if value is CacheMissError:
 *                     return callback()
 *             return self._on_stuff(miss_callback)             # <<<<<<<<<<<<<<
 * 
 *         def on_exc(self, callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_miss_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_miss_callback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1007
 *             return self._on_stuff(value_callback)
 * 
 *         def on_miss(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in a cache miss, the callback will be invoked
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_miss", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_miss_callback);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1017
 *             return self._on_stuff(miss_callback)
 * 
 *         def on_exc(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in an exception, the callback will be invoked
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_21on_exc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_20on_exc[] = "\n            If the operation results in an exception, the callback will be invoked\n            with an exc_info tuple as returned by sys.exc_info.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_21on_exc = {"on_exc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_21on_exc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_20on_exc};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_21on_exc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_exc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_exc", 1, 2, 2, 1); __PYX_ERR(0, 1017, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_exc") < 0)) __PYX_ERR(0, 1017, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_exc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1017, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.on_exc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_20on_exc(__pyx_self, __pyx_v_self, __pyx_v_callback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1022
 *             with an exc_info tuple as returned by sys.exc_info.
 *             """
 *             def exc_callback(value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, ExceptionWrapper):
 *                     return callback(value.value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_6on_exc_1exc_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_6on_exc_1exc_callback = {"exc_callback", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_6on_exc_1exc_callback, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_6on_exc_1exc_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exc_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_6on_exc_exc_callback(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_6on_exc_exc_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exc_callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1023
 *             """
 *             def exc_callback(value):
 *                 if isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     return callback(value.value)
 *             return self._on_stuff(exc_callback)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1024
 *             def exc_callback(value):
 *                 if isinstance(value, ExceptionWrapper):
 *                     return callback(value.value)             # <<<<<<<<<<<<<<
 *             return self._on_stuff(exc_callback)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_callback)) { __Pyx_RaiseClosureNameError("callback"); __PYX_ERR(0, 1024, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_callback; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1023
 *             """
 *             def exc_callback(value):
 *                 if isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     return callback(value.value)
 *             return self._on_stuff(exc_callback)
 */
  }

  /* "chorde/clients/async.py":1022
 *             with an exc_info tuple as returned by sys.exc_info.
 *             """
 *             def exc_callback(value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, ExceptionWrapper):
 *                     return callback(value.value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_exc.exc_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1017
 *             return self._on_stuff(miss_callback)
 * 
 *         def on_exc(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in an exception, the callback will be invoked
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_20on_exc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *__pyx_cur_scope;
  PyObject *__pyx_v_exc_callback = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_exc", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_4_on_exc(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_4_on_exc, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1017, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_callback = __pyx_v_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_callback);

  /* "chorde/clients/async.py":1022
 *             with an exc_info tuple as returned by sys.exc_info.
 *             """
 *             def exc_callback(value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, ExceptionWrapper):
 *                     return callback(value.value)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_6on_exc_1exc_callback, 0, __pyx_n_s_Future_on_exc_locals_exc_callbac, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_exc_callback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1025
 *                 if isinstance(value, ExceptionWrapper):
 *                     return callback(value.value)
 *             return self._on_stuff(exc_callback)             # <<<<<<<<<<<<<<
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_exc_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_exc_callback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1017
 *             return self._on_stuff(miss_callback)
 * 
 *         def on_exc(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in an exception, the callback will be invoked
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_exc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_callback);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1027
 *             return self._on_stuff(exc_callback)
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Handy method to set callbacks for all kinds of results, and it's actually
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_23on_any(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_22on_any[] = "\n            Handy method to set callbacks for all kinds of results, and it's actually\n            faster than calling on_X repeatedly. None callbacks will be ignored.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_23on_any = {"on_any", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_23on_any, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_22on_any};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_23on_any(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_on_value = 0;
  PyObject *__pyx_v_on_miss = 0;
  PyObject *__pyx_v_on_exc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_any (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_on_value,&__pyx_n_s_on_miss,&__pyx_n_s_on_exc,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_value);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_miss);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_exc);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_any") < 0)) __PYX_ERR(0, 1027, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_on_value = values[1];
    __pyx_v_on_miss = values[2];
    __pyx_v_on_exc = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_any", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1027, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.on_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_22on_any(__pyx_self, __pyx_v_self, __pyx_v_on_value, __pyx_v_on_miss, __pyx_v_on_exc);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1032
 *             faster than calling on_X repeatedly. None callbacks will be ignored.
 *             """
 *             def callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     if on_miss is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_6on_any_1callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_6on_any_1callback = {"callback", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_6on_any_1callback, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_6on_any_1callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_6on_any_callback(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_6on_any_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1033
 *             """
 *             def callback(value):
 *                 if value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     if on_miss is not None:
 *                         return on_miss()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_value == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1034
 *             def callback(value):
 *                 if value is CacheMissError:
 *                     if on_miss is not None:             # <<<<<<<<<<<<<<
 *                         return on_miss()
 *                 elif isinstance(value, ExceptionWrapper):
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_on_miss)) { __Pyx_RaiseClosureNameError("on_miss"); __PYX_ERR(0, 1034, __pyx_L1_error) }
    __pyx_t_3 = (__pyx_cur_scope->__pyx_v_on_miss != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":1035
 *                 if value is CacheMissError:
 *                     if on_miss is not None:
 *                         return on_miss()             # <<<<<<<<<<<<<<
 *                 elif isinstance(value, ExceptionWrapper):
 *                     if on_exc is not None:
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_cur_scope->__pyx_v_on_miss)) { __Pyx_RaiseClosureNameError("on_miss"); __PYX_ERR(0, 1035, __pyx_L1_error) }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_on_miss);
      __pyx_t_4 = __pyx_cur_scope->__pyx_v_on_miss; __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "chorde/clients/async.py":1034
 *             def callback(value):
 *                 if value is CacheMissError:
 *                     if on_miss is not None:             # <<<<<<<<<<<<<<
 *                         return on_miss()
 *                 elif isinstance(value, ExceptionWrapper):
 */
    }

    /* "chorde/clients/async.py":1033
 *             """
 *             def callback(value):
 *                 if value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     if on_miss is not None:
 *                         return on_miss()
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1036
 *                     if on_miss is not None:
 *                         return on_miss()
 *                 elif isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     if on_exc is not None:
 *                         return on_exc(value.value)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1037
 *                         return on_miss()
 *                 elif isinstance(value, ExceptionWrapper):
 *                     if on_exc is not None:             # <<<<<<<<<<<<<<
 *                         return on_exc(value.value)
 *                 else:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_on_exc)) { __Pyx_RaiseClosureNameError("on_exc"); __PYX_ERR(0, 1037, __pyx_L1_error) }
    __pyx_t_3 = (__pyx_cur_scope->__pyx_v_on_exc != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":1038
 *                 elif isinstance(value, ExceptionWrapper):
 *                     if on_exc is not None:
 *                         return on_exc(value.value)             # <<<<<<<<<<<<<<
 *                 else:
 *                     if on_value is not None:
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_cur_scope->__pyx_v_on_exc)) { __Pyx_RaiseClosureNameError("on_exc"); __PYX_ERR(0, 1038, __pyx_L1_error) }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_on_exc);
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_on_exc; __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "chorde/clients/async.py":1037
 *                         return on_miss()
 *                 elif isinstance(value, ExceptionWrapper):
 *                     if on_exc is not None:             # <<<<<<<<<<<<<<
 *                         return on_exc(value.value)
 *                 else:
 */
    }

    /* "chorde/clients/async.py":1036
 *                     if on_miss is not None:
 *                         return on_miss()
 *                 elif isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     if on_exc is not None:
 *                         return on_exc(value.value)
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1040
 *                         return on_exc(value.value)
 *                 else:
 *                     if on_value is not None:             # <<<<<<<<<<<<<<
 *                         return on_value(value)
 *             return self._on_stuff(callback)
 */
  /*else*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_on_value)) { __Pyx_RaiseClosureNameError("on_value"); __PYX_ERR(0, 1040, __pyx_L1_error) }
    __pyx_t_2 = (__pyx_cur_scope->__pyx_v_on_value != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "chorde/clients/async.py":1041
 *                 else:
 *                     if on_value is not None:
 *                         return on_value(value)             # <<<<<<<<<<<<<<
 *             return self._on_stuff(callback)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_cur_scope->__pyx_v_on_value)) { __Pyx_RaiseClosureNameError("on_value"); __PYX_ERR(0, 1041, __pyx_L1_error) }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_on_value);
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_on_value; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "chorde/clients/async.py":1040
 *                         return on_exc(value.value)
 *                 else:
 *                     if on_value is not None:             # <<<<<<<<<<<<<<
 *                         return on_value(value)
 *             return self._on_stuff(callback)
 */
    }
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1032
 *             faster than calling on_X repeatedly. None callbacks will be ignored.
 *             """
 *             def callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     if on_miss is not None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_any.callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1027
 *             return self._on_stuff(exc_callback)
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Handy method to set callbacks for all kinds of results, and it's actually
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_22on_any(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_value, PyObject *__pyx_v_on_miss, PyObject *__pyx_v_on_exc) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *__pyx_cur_scope;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_any", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_5_on_any(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_5_on_any, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1027, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_on_value = __pyx_v_on_value;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_on_value);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_on_value);
  __pyx_cur_scope->__pyx_v_on_miss = __pyx_v_on_miss;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_on_miss);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_on_miss);
  __pyx_cur_scope->__pyx_v_on_exc = __pyx_v_on_exc;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_on_exc);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_on_exc);

  /* "chorde/clients/async.py":1032
 *             faster than calling on_X repeatedly. None callbacks will be ignored.
 *             """
 *             def callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     if on_miss is not None:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_6on_any_1callback, 0, __pyx_n_s_Future_on_any_locals_callback, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_callback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1042
 *                     if on_value is not None:
 *                         return on_value(value)
 *             return self._on_stuff(callback)             # <<<<<<<<<<<<<<
 * 
 *         def on_any_once(self, on_value = None, on_miss = None, on_exc = None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_callback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1027
 *             return self._on_stuff(exc_callback)
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Handy method to set callbacks for all kinds of results, and it's actually
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_any", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_callback);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1044
 *             return self._on_stuff(callback)
 * 
 *         def on_any_once(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Like on_any, but will only set the callback if no other callback has been set
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_25on_any_once(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_24on_any_once[] = "\n            Like on_any, but will only set the callback if no other callback has been set\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_25on_any_once = {"on_any_once", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_25on_any_once, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_24on_any_once};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_25on_any_once(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_on_value = 0;
  PyObject *__pyx_v_on_miss = 0;
  PyObject *__pyx_v_on_exc = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_any_once (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_on_value,&__pyx_n_s_on_miss,&__pyx_n_s_on_exc,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_value);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_miss);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on_exc);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_any_once") < 0)) __PYX_ERR(0, 1044, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_on_value = values[1];
    __pyx_v_on_miss = values[2];
    __pyx_v_on_exc = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_any_once", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1044, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.on_any_once", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_24on_any_once(__pyx_self, __pyx_v_self, __pyx_v_on_value, __pyx_v_on_miss, __pyx_v_on_exc);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_24on_any_once(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_value, PyObject *__pyx_v_on_miss, PyObject *__pyx_v_on_exc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_any_once", 0);

  /* "chorde/clients/async.py":1048
 *             Like on_any, but will only set the callback if no other callback has been set
 *             """
 *             if not self._cb:             # <<<<<<<<<<<<<<
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1049
 *             """
 *             if not self._cb:
 *                 self.on_any(on_value, on_miss, on_exc)             # <<<<<<<<<<<<<<
 * 
 *         def on_done(self, callback):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_any); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_on_value, __pyx_v_on_miss, __pyx_v_on_exc};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_on_value, __pyx_v_on_miss, __pyx_v_on_exc};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_on_value);
      __Pyx_GIVEREF(__pyx_v_on_value);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_on_value);
      __Pyx_INCREF(__pyx_v_on_miss);
      __Pyx_GIVEREF(__pyx_v_on_miss);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_on_miss);
      __Pyx_INCREF(__pyx_v_on_exc);
      __Pyx_GIVEREF(__pyx_v_on_exc);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_on_exc);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":1048
 *             Like on_any, but will only set the callback if no other callback has been set
 *             """
 *             if not self._cb:             # <<<<<<<<<<<<<<
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 */
  }

  /* "chorde/clients/async.py":1044
 *             return self._on_stuff(callback)
 * 
 *         def on_any_once(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Like on_any, but will only set the callback if no other callback has been set
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_any_once", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1051
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 *         def on_done(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operation is done, the callback will be invoked without arguments,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_27on_done(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_26on_done[] = "\n            When the operation is done, the callback will be invoked without arguments,\n            regardless of the outcome. If the operation is cancelled, it won't be invoked.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_27on_done = {"on_done", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_27on_done, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_26on_done};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_27on_done(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_done (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_done", 1, 2, 2, 1); __PYX_ERR(0, 1051, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_done") < 0)) __PYX_ERR(0, 1051, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_done", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1051, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.on_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_26on_done(__pyx_self, __pyx_v_self, __pyx_v_callback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1056
 *             regardless of the outcome. If the operation is cancelled, it won't be invoked.
 *             """
 *             def done_callback(value):             # <<<<<<<<<<<<<<
 *                 return callback()
 *             return self._on_stuff(done_callback)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_7on_done_1done_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_7on_done_1done_callback = {"done_callback", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_7on_done_1done_callback, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_7on_done_1done_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_7on_done_done_callback(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_7on_done_done_callback(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done_callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1057
 *             """
 *             def done_callback(value):
 *                 return callback()             # <<<<<<<<<<<<<<
 *             return self._on_stuff(done_callback)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_callback)) { __Pyx_RaiseClosureNameError("callback"); __PYX_ERR(0, 1057, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_callback; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1056
 *             regardless of the outcome. If the operation is cancelled, it won't be invoked.
 *             """
 *             def done_callback(value):             # <<<<<<<<<<<<<<
 *                 return callback()
 *             return self._on_stuff(done_callback)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_done.done_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1051
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 *         def on_done(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operation is done, the callback will be invoked without arguments,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_26on_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *__pyx_cur_scope;
  PyObject *__pyx_v_done_callback = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_done", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_6_on_done(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_6_on_done, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1051, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_callback = __pyx_v_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_callback);

  /* "chorde/clients/async.py":1056
 *             regardless of the outcome. If the operation is cancelled, it won't be invoked.
 *             """
 *             def done_callback(value):             # <<<<<<<<<<<<<<
 *                 return callback()
 *             return self._on_stuff(done_callback)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_7on_done_1done_callback, 0, __pyx_n_s_Future_on_done_locals_done_callb, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_done_callback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1058
 *             def done_callback(value):
 *                 return callback()
 *             return self._on_stuff(done_callback)             # <<<<<<<<<<<<<<
 * 
 *         def chain(self, defer):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_done_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_done_callback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1051
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 *         def on_done(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operation is done, the callback will be invoked without arguments,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.on_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_done_callback);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1060
 *             return self._on_stuff(done_callback)
 * 
 *         def chain(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_29chain(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_28chain[] = "\n            Invoke all the callbacks of the other defer\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_29chain = {"chain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_29chain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_28chain};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_29chain(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_defer = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chain (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_defer,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("chain", 1, 2, 2, 1); __PYX_ERR(0, 1060, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chain") < 0)) __PYX_ERR(0, 1060, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_defer = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chain", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1060, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.chain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_28chain(__pyx_self, __pyx_v_self, __pyx_v_defer);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_28chain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_defer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("chain", 0);

  /* "chorde/clients/async.py":1064
 *             Invoke all the callbacks of the other defer
 *             """
 *             self._on_stuff(defer.set)             # <<<<<<<<<<<<<<
 * 
 *         def chain_std(self, defer):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_defer, __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1060
 *             return self._on_stuff(done_callback)
 * 
 *         def chain(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.Future.chain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1066
 *             self._on_stuff(defer.set)
 * 
 *         def chain_std(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer, without assuming the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_31chain_std(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_30chain_std[] = "\n            Invoke all the callbacks of the other defer, without assuming the other\n            defer follows our non-standard interface.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_31chain_std = {"chain_std", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_31chain_std, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_30chain_std};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_31chain_std(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_defer = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chain_std (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_defer,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_defer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("chain_std", 1, 2, 2, 1); __PYX_ERR(0, 1066, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chain_std") < 0)) __PYX_ERR(0, 1066, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_defer = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chain_std", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1066, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.chain_std", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_30chain_std(__pyx_self, __pyx_v_self, __pyx_v_defer);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1074
 *                 defer.set_result,
 *                 functools.partial(defer.set_exception, CacheMissError()),
 *                 lambda value : defer.set_exception(value[1] or value[0])             # <<<<<<<<<<<<<<
 *             )
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_9chain_std_lambda(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_9chain_std_lambda = {"lambda", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_9chain_std_lambda, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_9chain_std_lambda(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_defer)) { __Pyx_RaiseClosureNameError("defer"); __PYX_ERR(0, 1074, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_defer, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_value, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1074, __pyx_L1_error)
  if (!__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.Future.chain_std.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1066
 *             self._on_stuff(defer.set)
 * 
 *         def chain_std(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer, without assuming the other
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_30chain_std(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_defer) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("chain_std", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_7_chain_std(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_7_chain_std, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1066, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_defer = __pyx_v_defer;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_defer);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_defer);

  /* "chorde/clients/async.py":1071
 *             defer follows our non-standard interface.
 *             """
 *             return self.on_any(             # <<<<<<<<<<<<<<
 *                 defer.set_result,
 *                 functools.partial(defer.set_exception, CacheMissError()),
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "chorde/clients/async.py":1072
 *             """
 *             return self.on_any(
 *                 defer.set_result,             # <<<<<<<<<<<<<<
 *                 functools.partial(defer.set_exception, CacheMissError()),
 *                 lambda value : defer.set_exception(value[1] or value[0])
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_defer, __pyx_n_s_set_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "chorde/clients/async.py":1073
 *             return self.on_any(
 *                 defer.set_result,
 *                 functools.partial(defer.set_exception, CacheMissError()),             # <<<<<<<<<<<<<<
 *                 lambda value : defer.set_exception(value[1] or value[0])
 *             )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_functools); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_partial); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_defer, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":1074
 *                 defer.set_result,
 *                 functools.partial(defer.set_exception, CacheMissError()),
 *                 lambda value : defer.set_exception(value[1] or value[0])             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_9chain_std_lambda, 0, __pyx_n_s_Future_chain_std_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1066
 *             self._on_stuff(defer.set)
 * 
 *         def chain_std(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer, without assuming the other
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.Future.chain_std", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1077
 *             )
 * 
 *         def _on_stuff(self, callback, hasattr=hasattr):             # <<<<<<<<<<<<<<
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_24__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_hasattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_33_on_stuff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_33_on_stuff = {"_on_stuff", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_33_on_stuff, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_33_on_stuff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_hasattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_stuff (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callback,&__pyx_n_s_hasattr,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults9 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_hasattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_on_stuff", 0, 2, 3, 1); __PYX_ERR(0, 1077, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_on_stuff") < 0)) __PYX_ERR(0, 1077, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_callback = values[1];
    __pyx_v_hasattr = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_on_stuff", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1077, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future._on_stuff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_32_on_stuff(__pyx_self, __pyx_v_self, __pyx_v_callback, __pyx_v_hasattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_32_on_stuff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_hasattr) {
  PyObject *__pyx_v_cbap = NULL;
  PyObject *__pyx_v_docall = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_stuff", 0);

  /* "chorde/clients/async.py":1078
 * 
 *         def _on_stuff(self, callback, hasattr=hasattr):
 *             cbap = self._cb.append             # <<<<<<<<<<<<<<
 *             docall = hasattr(self, '_value')
 *             if not docall:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_append); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cbap = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1079
 *         def _on_stuff(self, callback, hasattr=hasattr):
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')             # <<<<<<<<<<<<<<
 *             if not docall:
 *                 with self._lock:
 */
  __Pyx_INCREF(__pyx_v_hasattr);
  __pyx_t_1 = __pyx_v_hasattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_value_2);
    __Pyx_GIVEREF(__pyx_n_s_value_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_value_2);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_docall = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1080
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')
 *             if not docall:             # <<<<<<<<<<<<<<
 *                 with self._lock:
 *                     docall = hasattr(self, '_value')
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_docall); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __pyx_t_7 = ((!__pyx_t_6) != 0);
  if (__pyx_t_7) {

    /* "chorde/clients/async.py":1081
 *             docall = hasattr(self, '_value')
 *             if not docall:
 *                 with self._lock:             # <<<<<<<<<<<<<<
 *                     docall = hasattr(self, '_value')
 *                     if not docall:
 */
    /*with:*/ {
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1081, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "chorde/clients/async.py":1082
 *             if not docall:
 *                 with self._lock:
 *                     docall = hasattr(self, '_value')             # <<<<<<<<<<<<<<
 *                     if not docall:
 *                         cbap(callback)
 */
            __Pyx_INCREF(__pyx_v_hasattr);
            __pyx_t_1 = __pyx_v_hasattr; __pyx_t_5 = NULL;
            __pyx_t_4 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_4 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_1)) {
              PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_n_s_value_2};
              __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L8_error)
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_GOTREF(__pyx_t_2);
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
              PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_n_s_value_2};
              __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L8_error)
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_GOTREF(__pyx_t_2);
            } else
            #endif
            {
              __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1082, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              if (__pyx_t_5) {
                __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
              }
              __Pyx_INCREF(__pyx_v_self);
              __Pyx_GIVEREF(__pyx_v_self);
              PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_self);
              __Pyx_INCREF(__pyx_n_s_value_2);
              __Pyx_GIVEREF(__pyx_n_s_value_2);
              PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_value_2);
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF_SET(__pyx_v_docall, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "chorde/clients/async.py":1083
 *                 with self._lock:
 *                     docall = hasattr(self, '_value')
 *                     if not docall:             # <<<<<<<<<<<<<<
 *                         cbap(callback)
 *             if docall:
 */
            __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_docall); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1083, __pyx_L8_error)
            __pyx_t_6 = ((!__pyx_t_7) != 0);
            if (__pyx_t_6) {

              /* "chorde/clients/async.py":1084
 *                     docall = hasattr(self, '_value')
 *                     if not docall:
 *                         cbap(callback)             # <<<<<<<<<<<<<<
 *             if docall:
 *                 callback(self._value)
 */
              __Pyx_INCREF(__pyx_v_cbap);
              __pyx_t_1 = __pyx_v_cbap; __pyx_t_3 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_3)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                }
              }
              __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_callback);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "chorde/clients/async.py":1083
 *                 with self._lock:
 *                     docall = hasattr(self, '_value')
 *                     if not docall:             # <<<<<<<<<<<<<<
 *                         cbap(callback)
 *             if docall:
 */
            }

            /* "chorde/clients/async.py":1081
 *             docall = hasattr(self, '_value')
 *             if not docall:
 *                 with self._lock:             # <<<<<<<<<<<<<<
 *                     docall = hasattr(self, '_value')
 *                     if not docall:
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("chorde.clients.async.Future._on_stuff", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 1081, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1081, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1081, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_6 < 0) __PYX_ERR(0, 1081, __pyx_L10_except_error)
            __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
            if (__pyx_t_7) {
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
              __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
              __PYX_ERR(0, 1081, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_8) {
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple_, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1081, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L18;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L1_error;
      __pyx_L18:;
    }

    /* "chorde/clients/async.py":1080
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')
 *             if not docall:             # <<<<<<<<<<<<<<
 *                 with self._lock:
 *                     docall = hasattr(self, '_value')
 */
  }

  /* "chorde/clients/async.py":1085
 *                     if not docall:
 *                         cbap(callback)
 *             if docall:             # <<<<<<<<<<<<<<
 *                 callback(self._value)
 *             return self
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_docall); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1085, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "chorde/clients/async.py":1086
 *                         cbap(callback)
 *             if docall:
 *                 callback(self._value)             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_callback);
    __pyx_t_2 = __pyx_v_callback; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "chorde/clients/async.py":1085
 *                     if not docall:
 *                         cbap(callback)
 *             if docall:             # <<<<<<<<<<<<<<
 *                 callback(self._value)
 *             return self
 */
  }

  /* "chorde/clients/async.py":1087
 *             if docall:
 *                 callback(self._value)
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         def add_done_callback(self, callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1077
 *             )
 * 
 *         def _on_stuff(self, callback, hasattr=hasattr):             # <<<<<<<<<<<<<<
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future._on_stuff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cbap);
  __Pyx_XDECREF(__pyx_v_docall);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1089
 *             return self
 * 
 *         def add_done_callback(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operatio is done, the callback will be invoked with the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_35add_done_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_34add_done_callback[] = "\n            When the operatio is done, the callback will be invoked with the\n            future object as argument.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_35add_done_callback = {"add_done_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_35add_done_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_34add_done_callback};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_35add_done_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_callback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_done_callback (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_done_callback", 1, 2, 2, 1); __PYX_ERR(0, 1089, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_done_callback") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_done_callback", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.add_done_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_34add_done_callback(__pyx_self, __pyx_v_self, __pyx_v_callback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1095
 *             """
 *             me = weakref.ref(self)
 *             def weak_callback(value):             # <<<<<<<<<<<<<<
 *                 self = me()
 *                 if self is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_17add_done_callback_1weak_callback(PyObject *__pyx_self, PyObject *__pyx_v_value); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_17add_done_callback_1weak_callback = {"weak_callback", (PyCFunction)__pyx_pw_6chorde_7clients_5async_6Future_17add_done_callback_1weak_callback, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_17add_done_callback_1weak_callback(PyObject *__pyx_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weak_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_17add_done_callback_weak_callback(__pyx_self, ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_17add_done_callback_weak_callback(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_value) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *__pyx_outer_scope;
  PyObject *__pyx_v_self = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weak_callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1096
 *             me = weakref.ref(self)
 *             def weak_callback(value):
 *                 self = me()             # <<<<<<<<<<<<<<
 *                 if self is not None:
 *                     return callback(self)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_me)) { __Pyx_RaiseClosureNameError("me"); __PYX_ERR(0, 1096, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_me);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_me; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1097
 *             def weak_callback(value):
 *                 self = me()
 *                 if self is not None:             # <<<<<<<<<<<<<<
 *                     return callback(self)
 *             return self._on_stuff(weak_callback)
 */
  __pyx_t_4 = (__pyx_v_self != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":1098
 *                 self = me()
 *                 if self is not None:
 *                     return callback(self)             # <<<<<<<<<<<<<<
 *             return self._on_stuff(weak_callback)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_callback)) { __Pyx_RaiseClosureNameError("callback"); __PYX_ERR(0, 1098, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_callback; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1097
 *             def weak_callback(value):
 *                 self = me()
 *                 if self is not None:             # <<<<<<<<<<<<<<
 *                     return callback(self)
 *             return self._on_stuff(weak_callback)
 */
  }

  /* "chorde/clients/async.py":1095
 *             """
 *             me = weakref.ref(self)
 *             def weak_callback(value):             # <<<<<<<<<<<<<<
 *                 self = me()
 *                 if self is not None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.add_done_callback.weak_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1089
 *             return self
 * 
 *         def add_done_callback(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operatio is done, the callback will be invoked with the
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_34add_done_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *__pyx_cur_scope;
  PyObject *__pyx_v_weak_callback = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_done_callback", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1089, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_callback = __pyx_v_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_callback);

  /* "chorde/clients/async.py":1094
 *             future object as argument.
 *             """
 *             me = weakref.ref(self)             # <<<<<<<<<<<<<<
 *             def weak_callback(value):
 *                 self = me()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_weakref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_me = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1095
 *             """
 *             me = weakref.ref(self)
 *             def weak_callback(value):             # <<<<<<<<<<<<<<
 *                 self = me()
 *                 if self is not None:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_17add_done_callback_1weak_callback, 0, __pyx_n_s_Future_add_done_callback_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_weak_callback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1099
 *                 if self is not None:
 *                     return callback(self)
 *             return self._on_stuff(weak_callback)             # <<<<<<<<<<<<<<
 * 
 *         def done(self, hasattr=hasattr, getattr=getattr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_stuff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_weak_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_weak_callback);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1089
 *             return self
 * 
 *         def add_done_callback(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operatio is done, the callback will be invoked with the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.Future.add_done_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weak_callback);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1101
 *             return self._on_stuff(weak_callback)
 * 
 *         def done(self, hasattr=hasattr, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has finished, in a result or exception or cancelled, and False if not.
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_37done(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_36done[] = "\n            Return True if the operation has finished, in a result or exception or cancelled, and False if not.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_37done = {"done", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_37done, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_36done};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_37done(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_hasattr,&__pyx_n_s_getattr,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_hasattr;
    values[2] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "done") < 0)) __PYX_ERR(0, 1101, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_hasattr = values[1];
    __pyx_v_getattr = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("done", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_36done(__pyx_self, __pyx_v_self, __pyx_v_hasattr, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_36done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);

  /* "chorde/clients/async.py":1105
 *             Return True if the operation has finished, in a result or exception or cancelled, and False if not.
 *             """
 *             return hasattr(self, '_value') or getattr(self, '_cancelled', False)             # <<<<<<<<<<<<<<
 * 
 *         def running(self, getattr=getattr):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_hasattr);
  __pyx_t_3 = __pyx_v_hasattr; __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_value_2);
    __Pyx_GIVEREF(__pyx_n_s_value_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_value_2);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1105, __pyx_L1_error)
  if (!__pyx_t_7) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_3 = __pyx_v_getattr; __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_self, __pyx_n_s_cancelled, Py_False};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_self, __pyx_n_s_cancelled, Py_False};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_cancelled);
    __Pyx_GIVEREF(__pyx_n_s_cancelled);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_n_s_cancelled);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, Py_False);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1101
 *             return self._on_stuff(weak_callback)
 * 
 *         def done(self, hasattr=hasattr, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has finished, in a result or exception or cancelled, and False if not.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.Future.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1107
 *             return hasattr(self, '_value') or getattr(self, '_cancelled', False)
 * 
 *         def running(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation is running and cannot be cancelled. False if not running
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_39running(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_38running[] = "\n            Return True if the operation is running and cannot be cancelled. False if not running\n            (yet or done).\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_39running = {"running", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_39running, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_38running};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_39running(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("running (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "running") < 0)) __PYX_ERR(0, 1107, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("running", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1107, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.running", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_38running(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_38running(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("running", 0);

  /* "chorde/clients/async.py":1112
 *             (yet or done).
 *             """
 *             return getattr(self, '_running', False)             # <<<<<<<<<<<<<<
 * 
 *         def cancelled(self, getattr=getattr):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_running, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_running, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_running);
    __Pyx_GIVEREF(__pyx_n_s_running);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_running);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_False);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1107
 *             return hasattr(self, '_value') or getattr(self, '_cancelled', False)
 * 
 *         def running(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation is running and cannot be cancelled. False if not running
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future.running", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1114
 *             return getattr(self, '_running', False)
 * 
 *         def cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has been cancelled successfully.
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_41cancelled(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_40cancelled[] = "\n            Return True if the operation has been cancelled successfully.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_41cancelled = {"cancelled", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_41cancelled, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_40cancelled};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_41cancelled(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancelled (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancelled") < 0)) __PYX_ERR(0, 1114, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cancelled", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1114, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_40cancelled(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_40cancelled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancelled", 0);

  /* "chorde/clients/async.py":1118
 *             Return True if the operation has been cancelled successfully.
 *             """
 *             return getattr(self, '_cancelled', False)             # <<<<<<<<<<<<<<
 * 
 *         def cancel_pending(self, getattr=getattr):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancelled, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancelled, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_cancelled);
    __Pyx_GIVEREF(__pyx_n_s_cancelled);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cancelled);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_False);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1114
 *             return getattr(self, '_running', False)
 * 
 *         def cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has been cancelled successfully.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1120
 *             return getattr(self, '_cancelled', False)
 * 
 *         def cancel_pending(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if cancel was called.
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_43cancel_pending(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_42cancel_pending[] = "\n            Return True if cancel was called.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_43cancel_pending = {"cancel_pending", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_43cancel_pending, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_42cancel_pending};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_43cancel_pending(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_pending (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults13 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel_pending") < 0)) __PYX_ERR(0, 1120, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cancel_pending", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1120, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.cancel_pending", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_42cancel_pending(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_42cancel_pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel_pending", 0);

  /* "chorde/clients/async.py":1124
 *             Return True if cancel was called.
 *             """
 *             return getattr(self, '_cancel_pending', False)             # <<<<<<<<<<<<<<
 * 
 *         def cancel(self, getattr=getattr):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancel_pending, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancel_pending, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_cancel_pending);
    __Pyx_GIVEREF(__pyx_n_s_cancel_pending);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cancel_pending);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_False);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1120
 *             return getattr(self, '_cancelled', False)
 * 
 *         def cancel_pending(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if cancel was called.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future.cancel_pending", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1126
 *             return getattr(self, '_cancel_pending', False)
 * 
 *         def cancel(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Request cancelling of the operation. If the operation cannot be cancelled,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_34__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_45cancel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_44cancel[] = "\n            Request cancelling of the operation. If the operation cannot be cancelled,\n            it will return False. Otherwise, it will return True.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_45cancel = {"cancel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_45cancel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_44cancel};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_45cancel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults14 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel") < 0)) __PYX_ERR(0, 1126, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cancel", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1126, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_44cancel(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_44cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel", 0);

  /* "chorde/clients/async.py":1131
 *             it will return False. Otherwise, it will return True.
 *             """
 *             if getattr(self, '_cancelled', False):             # <<<<<<<<<<<<<<
 *                 return False
 *             else:
 */
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancelled, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancelled, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_cancelled);
    __Pyx_GIVEREF(__pyx_n_s_cancelled);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cancelled);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_False);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":1132
 *             """
 *             if getattr(self, '_cancelled', False):
 *                 return False             # <<<<<<<<<<<<<<
 *             else:
 *                 self._cancel_pending = True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1131
 *             it will return False. Otherwise, it will return True.
 *             """
 *             if getattr(self, '_cancelled', False):             # <<<<<<<<<<<<<<
 *                 return False
 *             else:
 */
  }

  /* "chorde/clients/async.py":1134
 *                 return False
 *             else:
 *                 self._cancel_pending = True             # <<<<<<<<<<<<<<
 *                 return True
 * 
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cancel_pending, Py_True) < 0) __PYX_ERR(0, 1134, __pyx_L1_error)

    /* "chorde/clients/async.py":1135
 *             else:
 *                 self._cancel_pending = True
 *                 return True             # <<<<<<<<<<<<<<
 * 
 *         def set_running_or_notify_cancelled(self, getattr=getattr):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":1126
 *             return getattr(self, '_cancel_pending', False)
 * 
 *         def cancel(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Request cancelling of the operation. If the operation cannot be cancelled,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.Future.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1137
 *                 return True
 * 
 *         def set_running_or_notify_cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             To be invoked by executors before executing the operation. If it returns True,
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_36__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_getattr);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_47set_running_or_notify_cancelled(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_46set_running_or_notify_cancelled[] = "\n            To be invoked by executors before executing the operation. If it returns True,\n            the operation may go ahead, and if False, a cancel has been requested and the\n            operation should not be initiated, all threads waiting for the operation will\n            be wakened immediately and the future will be marked as cancelled.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_47set_running_or_notify_cancelled = {"set_running_or_notify_cancelled", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_47set_running_or_notify_cancelled, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_46set_running_or_notify_cancelled};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_47set_running_or_notify_cancelled(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getattr = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_running_or_notify_cancelled (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getattr,0};
    PyObject* values[2] = {0,0};
    __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_getattr;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_running_or_notify_cancelled") < 0)) __PYX_ERR(0, 1137, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_getattr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_running_or_notify_cancelled", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1137, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.set_running_or_notify_cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_46set_running_or_notify_cancelled(__pyx_self, __pyx_v_self, __pyx_v_getattr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_46set_running_or_notify_cancelled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getattr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_running_or_notify_cancelled", 0);

  /* "chorde/clients/async.py":1144
 *             be wakened immediately and the future will be marked as cancelled.
 *             """
 *             if getattr(self, '_cancel_pending', False):             # <<<<<<<<<<<<<<
 *                 self._cancelled = True
 *                 self._running = False
 */
  __Pyx_INCREF(__pyx_v_getattr);
  __pyx_t_2 = __pyx_v_getattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancel_pending, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_cancel_pending, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_cancel_pending);
    __Pyx_GIVEREF(__pyx_n_s_cancel_pending);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cancel_pending);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_False);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":1145
 *             """
 *             if getattr(self, '_cancel_pending', False):
 *                 self._cancelled = True             # <<<<<<<<<<<<<<
 *                 self._running = False
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cancelled, Py_True) < 0) __PYX_ERR(0, 1145, __pyx_L1_error)

    /* "chorde/clients/async.py":1146
 *             if getattr(self, '_cancel_pending', False):
 *                 self._cancelled = True
 *                 self._running = False             # <<<<<<<<<<<<<<
 * 
 *                 # Notify waiters and callbacks
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_running, Py_False) < 0) __PYX_ERR(0, 1146, __pyx_L1_error)

    /* "chorde/clients/async.py":1149
 * 
 *                 # Notify waiters and callbacks
 *                 self.set_exception(CancelledError())             # <<<<<<<<<<<<<<
 * 
 *                 return False
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "chorde/clients/async.py":1151
 *                 self.set_exception(CancelledError())
 * 
 *                 return False             # <<<<<<<<<<<<<<
 *             else:
 *                 self._running = True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1144
 *             be wakened immediately and the future will be marked as cancelled.
 *             """
 *             if getattr(self, '_cancel_pending', False):             # <<<<<<<<<<<<<<
 *                 self._cancelled = True
 *                 self._running = False
 */
  }

  /* "chorde/clients/async.py":1153
 *                 return False
 *             else:
 *                 self._running = True             # <<<<<<<<<<<<<<
 *                 return True
 * 
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_running, Py_True) < 0) __PYX_ERR(0, 1153, __pyx_L1_error)

    /* "chorde/clients/async.py":1154
 *             else:
 *                 self._running = True
 *                 return True             # <<<<<<<<<<<<<<
 * 
 *         def result(self, timeout=None, hasattr=hasattr, getattr=getattr, isinstance=isinstance, norecurse=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":1137
 *                 return True
 * 
 *         def set_running_or_notify_cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             To be invoked by executors before executing the operation. If it returns True,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.Future.set_running_or_notify_cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1156
 *                 return True
 * 
 *         def result(self, timeout=None, hasattr=hasattr, getattr=getattr, isinstance=isinstance, norecurse=False):             # <<<<<<<<<<<<<<
 *             """
 *             Return the operation's result, if any. If an exception was the result, re-raise it.
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_38__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_hasattr);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_hasattr);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_getattr);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_getattr);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_getattr);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_isinstance);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_isinstance);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_isinstance);
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False));
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_49result(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_48result[] = "\n            Return the operation's result, if any. If an exception was the result, re-raise it.\n            If it was cancelled, raises CancelledError, and if timeout is specified and not None,\n            and the specified time elapses without a result available, raises TimeoutError.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_49result = {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_49result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_48result};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_49result(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_hasattr = 0;
  PyObject *__pyx_v_getattr = 0;
  PyObject *__pyx_v_isinstance = 0;
  PyObject *__pyx_v_norecurse = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("result (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_timeout,&__pyx_n_s_hasattr,&__pyx_n_s_getattr,&__pyx_n_s_isinstance,&__pyx_n_s_norecurse,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    __pyx_defaults16 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self);
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = __pyx_dynamic_args->__pyx_arg_hasattr;
    values[3] = __pyx_dynamic_args->__pyx_arg_getattr;
    values[4] = __pyx_dynamic_args->__pyx_arg_isinstance;
    values[5] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasattr);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getattr);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isinstance);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norecurse);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "result") < 0)) __PYX_ERR(0, 1156, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_timeout = values[1];
    __pyx_v_hasattr = values[2];
    __pyx_v_getattr = values[3];
    __pyx_v_isinstance = values[4];
    __pyx_v_norecurse = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("result", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1156, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_48result(__pyx_self, __pyx_v_self, __pyx_v_timeout, __pyx_v_hasattr, __pyx_v_getattr, __pyx_v_isinstance, __pyx_v_norecurse);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_48result(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_timeout, PyObject *__pyx_v_hasattr, PyObject *__pyx_v_getattr, PyObject *__pyx_v_isinstance, PyObject *__pyx_v_norecurse) {
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_event = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("result", 0);
  __Pyx_INCREF(__pyx_v_timeout);

  /* "chorde/clients/async.py":1162
 *             and the specified time elapses without a result available, raises TimeoutError.
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):
 */
  __Pyx_INCREF(__pyx_v_hasattr);
  __pyx_t_2 = __pyx_v_hasattr; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_n_s_value_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_value_2);
    __Pyx_GIVEREF(__pyx_n_s_value_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_value_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "chorde/clients/async.py":1163
 *             """
 *             if hasattr(self, '_value'):
 *                 value = self._value             # <<<<<<<<<<<<<<
 *                 if isinstance(value, ExceptionWrapper):
 *                     raise value.value[0], value.value[1], value.value[2]
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":1164
 *             if hasattr(self, '_value'):
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     raise value.value[0], value.value[1], value.value[2]
 *                 elif value is CacheMissError:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_isinstance);
    __pyx_t_5 = __pyx_v_isinstance; __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_value, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_value, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_t_6)) {

      /* "chorde/clients/async.py":1165
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):
 *                     raise value.value[0], value.value[1], value.value[2]             # <<<<<<<<<<<<<<
 *                 elif value is CacheMissError:
 *                     raise CacheMissError
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_5, __pyx_t_7, __pyx_t_2, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1165, __pyx_L1_error)

      /* "chorde/clients/async.py":1164
 *             if hasattr(self, '_value'):
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     raise value.value[0], value.value[1], value.value[2]
 *                 elif value is CacheMissError:
 */
    }

    /* "chorde/clients/async.py":1166
 *                 if isinstance(value, ExceptionWrapper):
 *                     raise value.value[0], value.value[1], value.value[2]
 *                 elif value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     raise CacheMissError
 *                 else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__pyx_v_value == __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (unlikely(__pyx_t_8)) {

      /* "chorde/clients/async.py":1167
 *                     raise value.value[0], value.value[1], value.value[2]
 *                 elif value is CacheMissError:
 *                     raise CacheMissError             # <<<<<<<<<<<<<<
 *                 else:
 *                     return self._value
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1167, __pyx_L1_error)

      /* "chorde/clients/async.py":1166
 *                 if isinstance(value, ExceptionWrapper):
 *                     raise value.value[0], value.value[1], value.value[2]
 *                 elif value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     raise CacheMissError
 *                 else:
 */
    }

    /* "chorde/clients/async.py":1169
 *                     raise CacheMissError
 *                 else:
 *                     return self._value             # <<<<<<<<<<<<<<
 *             elif self.cancelled():
 *                 raise CancelledError
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "chorde/clients/async.py":1162
 *             and the specified time elapses without a result available, raises TimeoutError.
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):
 */
  }

  /* "chorde/clients/async.py":1170
 *                 else:
 *                     return self._value
 *             elif self.cancelled():             # <<<<<<<<<<<<<<
 *                 raise CancelledError
 *             else:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cancelled_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_8)) {

    /* "chorde/clients/async.py":1171
 *                     return self._value
 *             elif self.cancelled():
 *                 raise CancelledError             # <<<<<<<<<<<<<<
 *             else:
 *                 if timeout == 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1171, __pyx_L1_error)

    /* "chorde/clients/async.py":1170
 *                 else:
 *                     return self._value
 *             elif self.cancelled():             # <<<<<<<<<<<<<<
 *                 raise CancelledError
 *             else:
 */
  }

  /* "chorde/clients/async.py":1173
 *                 raise CancelledError
 *             else:
 *                 if timeout == 0:             # <<<<<<<<<<<<<<
 *                     raise TimeoutError
 *                 else:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_timeout, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1173, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_8)) {

      /* "chorde/clients/async.py":1174
 *             else:
 *                 if timeout == 0:
 *                     raise TimeoutError             # <<<<<<<<<<<<<<
 *                 else:
 *                     # Wait for it
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1174, __pyx_L1_error)

      /* "chorde/clients/async.py":1173
 *                 raise CancelledError
 *             else:
 *                 if timeout == 0:             # <<<<<<<<<<<<<<
 *                     raise TimeoutError
 *                 else:
 */
    }

    /* "chorde/clients/async.py":1177
 *                 else:
 *                     # Wait for it
 *                     event = getattr(self, '_done_event', None)             # <<<<<<<<<<<<<<
 *                     if event is None:
 *                         event = self._done_event = threading.Event()
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_getattr);
      __pyx_t_7 = __pyx_v_getattr; __pyx_t_5 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_4 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self, __pyx_n_s_done_event_2, Py_None};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self, __pyx_n_s_done_event_2, Py_None};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_self);
        __Pyx_GIVEREF(__pyx_v_self);
        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_self);
        __Pyx_INCREF(__pyx_n_s_done_event_2);
        __Pyx_GIVEREF(__pyx_n_s_done_event_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_n_s_done_event_2);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_4, Py_None);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_event = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "chorde/clients/async.py":1178
 *                     # Wait for it
 *                     event = getattr(self, '_done_event', None)
 *                     if event is None:             # <<<<<<<<<<<<<<
 *                         event = self._done_event = threading.Event()
 *                     # First loop eagerly waits on the recently-created event
 */
      __pyx_t_8 = (__pyx_v_event == Py_None);
      __pyx_t_6 = (__pyx_t_8 != 0);
      if (__pyx_t_6) {

        /* "chorde/clients/async.py":1179
 *                     event = getattr(self, '_done_event', None)
 *                     if event is None:
 *                         event = self._done_event = threading.Event()             # <<<<<<<<<<<<<<
 *                     # First loop eagerly waits on the recently-created event
 *                     # Second loop grabs the instance event (which could have been
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_threading); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Event); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_event, __pyx_t_2);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_done_event_2, __pyx_t_2) < 0) __PYX_ERR(0, 1179, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "chorde/clients/async.py":1178
 *                     # Wait for it
 *                     event = getattr(self, '_done_event', None)
 *                     if event is None:             # <<<<<<<<<<<<<<
 *                         event = self._done_event = threading.Event()
 *                     # First loop eagerly waits on the recently-created event
 */
      }

      /* "chorde/clients/async.py":1184
 *                     # clobbered by another thread). This is lockless yet safe,
 *                     # and quick on the most common condition (no contention)
 *                     for timeout in (0, timeout):             # <<<<<<<<<<<<<<
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)
 */
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_INCREF(__pyx_v_timeout);
      __Pyx_GIVEREF(__pyx_v_timeout);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_timeout);
      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (__pyx_t_9 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1184, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "chorde/clients/async.py":1185
 *                     # and quick on the most common condition (no contention)
 *                     for timeout in (0, timeout):
 *                         if event.wait(timeout) and not norecurse:             # <<<<<<<<<<<<<<
 *                             return self.result(0, norecurse=True)
 *                         elif self.cancelled():
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_wait); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_timeout);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_8) {
        } else {
          __pyx_t_6 = __pyx_t_8;
          goto __pyx_L10_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_norecurse); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1185, __pyx_L1_error)
        __pyx_t_10 = ((!__pyx_t_8) != 0);
        __pyx_t_6 = __pyx_t_10;
        __pyx_L10_bool_binop_done:;
        if (__pyx_t_6) {

          /* "chorde/clients/async.py":1186
 *                     for timeout in (0, timeout):
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)             # <<<<<<<<<<<<<<
 *                         elif self.cancelled():
 *                             raise CancelledError
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1186, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_norecurse, Py_True) < 0) __PYX_ERR(0, 1186, __pyx_L1_error)
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1186, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_r = __pyx_t_5;
          __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L0;

          /* "chorde/clients/async.py":1185
 *                     # and quick on the most common condition (no contention)
 *                     for timeout in (0, timeout):
 *                         if event.wait(timeout) and not norecurse:             # <<<<<<<<<<<<<<
 *                             return self.result(0, norecurse=True)
 *                         elif self.cancelled():
 */
        }

        /* "chorde/clients/async.py":1187
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)
 *                         elif self.cancelled():             # <<<<<<<<<<<<<<
 *                             raise CancelledError
 *                         else:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cancelled_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(__pyx_t_6)) {

          /* "chorde/clients/async.py":1188
 *                             return self.result(0, norecurse=True)
 *                         elif self.cancelled():
 *                             raise CancelledError             # <<<<<<<<<<<<<<
 *                         else:
 *                             time.sleep(0) # < give other threads a chance
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_Raise(__pyx_t_5, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __PYX_ERR(0, 1188, __pyx_L1_error)

          /* "chorde/clients/async.py":1187
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)
 *                         elif self.cancelled():             # <<<<<<<<<<<<<<
 *                             raise CancelledError
 *                         else:
 */
        }

        /* "chorde/clients/async.py":1190
 *                             raise CancelledError
 *                         else:
 *                             time.sleep(0) # < give other threads a chance             # <<<<<<<<<<<<<<
 *                             event = self._done_event
 *                     else:
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1190, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1190, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "chorde/clients/async.py":1191
 *                         else:
 *                             time.sleep(0) # < give other threads a chance
 *                             event = self._done_event             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise TimeoutError
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_done_event_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF_SET(__pyx_v_event, __pyx_t_5);
          __pyx_t_5 = 0;
        }

        /* "chorde/clients/async.py":1184
 *                     # clobbered by another thread). This is lockless yet safe,
 *                     # and quick on the most common condition (no contention)
 *                     for timeout in (0, timeout):             # <<<<<<<<<<<<<<
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)
 */
      }
      /*else*/ {

        /* "chorde/clients/async.py":1193
 *                             event = self._done_event
 *                     else:
 *                         raise TimeoutError             # <<<<<<<<<<<<<<
 * 
 *         def exception(self, timeout=None):
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 1193, __pyx_L1_error)
      }

      /* "chorde/clients/async.py":1184
 *                     # clobbered by another thread). This is lockless yet safe,
 *                     # and quick on the most common condition (no contention)
 *                     for timeout in (0, timeout):             # <<<<<<<<<<<<<<
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)
 */
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }

  /* "chorde/clients/async.py":1156
 *                 return True
 * 
 *         def result(self, timeout=None, hasattr=hasattr, getattr=getattr, isinstance=isinstance, norecurse=False):             # <<<<<<<<<<<<<<
 *             """
 *             Return the operation's result, if any. If an exception was the result, re-raise it.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.Future.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_event);
  __Pyx_XDECREF(__pyx_v_timeout);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1195
 *                         raise TimeoutError
 * 
 *         def exception(self, timeout=None):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation resulted in an exception, return the exception object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_51exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_6Future_50exception[] = "\n            If the operation resulted in an exception, return the exception object.\n            Otherwise, return None. If the operation has been cancelled, raises CancelledError,\n            and if timeout is specified and not None, and the specified time elapses without\n            a result available, raises TimeoutError.\n            ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_6Future_51exception = {"exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_6Future_51exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_6Future_50exception};
static PyObject *__pyx_pw_6chorde_7clients_5async_6Future_51exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_timeout = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exception (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_timeout,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exception") < 0)) __PYX_ERR(0, 1195, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_timeout = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1195, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.Future.exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_6Future_50exception(__pyx_self, __pyx_v_self, __pyx_v_timeout);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_6Future_50exception(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_timeout) {
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exception", 0);

  /* "chorde/clients/async.py":1202
 *             a result available, raises TimeoutError.
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_value_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1202, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":1203
 *             """
 *             if hasattr(self, '_value'):
 *                 value = self._value             # <<<<<<<<<<<<<<
 *                 if isinstance(value, ExceptionWrapper):
 *                     return value.value[1] or value.value[0]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_value = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "chorde/clients/async.py":1204
 *             if hasattr(self, '_value'):
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     return value.value[1] or value.value[0]
 *                 elif value is CacheMissError:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1204, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "chorde/clients/async.py":1205
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):
 *                     return value.value[1] or value.value[0]             # <<<<<<<<<<<<<<
 *                 elif value is CacheMissError:
 *                     return CacheMissError
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1205, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_3 = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L5_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_L5_bool_binop_done:;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "chorde/clients/async.py":1204
 *             if hasattr(self, '_value'):
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):             # <<<<<<<<<<<<<<
 *                     return value.value[1] or value.value[0]
 *                 elif value is CacheMissError:
 */
    }

    /* "chorde/clients/async.py":1206
 *                 if isinstance(value, ExceptionWrapper):
 *                     return value.value[1] or value.value[0]
 *                 elif value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     return CacheMissError
 *                 else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__pyx_v_value == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":1207
 *                     return value.value[1] or value.value[0]
 *                 elif value is CacheMissError:
 *                     return CacheMissError             # <<<<<<<<<<<<<<
 *                 else:
 *                     return None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "chorde/clients/async.py":1206
 *                 if isinstance(value, ExceptionWrapper):
 *                     return value.value[1] or value.value[0]
 *                 elif value is CacheMissError:             # <<<<<<<<<<<<<<
 *                     return CacheMissError
 *                 else:
 */
    }

    /* "chorde/clients/async.py":1209
 *                     return CacheMissError
 *                 else:
 *                     return None             # <<<<<<<<<<<<<<
 *             elif self.cancelled():
 *                 raise CancelledError
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
    }

    /* "chorde/clients/async.py":1202
 *             a result available, raises TimeoutError.
 *             """
 *             if hasattr(self, '_value'):             # <<<<<<<<<<<<<<
 *                 value = self._value
 *                 if isinstance(value, ExceptionWrapper):
 */
  }

  /* "chorde/clients/async.py":1210
 *                 else:
 *                     return None
 *             elif self.cancelled():             # <<<<<<<<<<<<<<
 *                 raise CancelledError
 *             else:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cancelled_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "chorde/clients/async.py":1211
 *                     return None
 *             elif self.cancelled():
 *                 raise CancelledError             # <<<<<<<<<<<<<<
 *             else:
 *                 try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1211, __pyx_L1_error)

    /* "chorde/clients/async.py":1210
 *                 else:
 *                     return None
 *             elif self.cancelled():             # <<<<<<<<<<<<<<
 *                 raise CancelledError
 *             else:
 */
  }

  /* "chorde/clients/async.py":1213
 *                 raise CancelledError
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.result()
 *                     return None
 */
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "chorde/clients/async.py":1214
 *             else:
 *                 try:
 *                     self.result()             # <<<<<<<<<<<<<<
 *                     return None
 *                 except CancelledError:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1214, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "chorde/clients/async.py":1215
 *                 try:
 *                     self.result()
 *                     return None             # <<<<<<<<<<<<<<
 *                 except CancelledError:
 *                     raise
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L11_try_return;

        /* "chorde/clients/async.py":1213
 *                 raise CancelledError
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.result()
 *                     return None
 */
      }
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "chorde/clients/async.py":1216
 *                     self.result()
 *                     return None
 *                 except CancelledError:             # <<<<<<<<<<<<<<
 *                     raise
 *                 except Exception,e:
 */
      __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1216, __pyx_L9_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
      if (__pyx_t_10) {
        __Pyx_AddTraceback("chorde.clients.async.Future.exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 1216, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_3);

        /* "chorde/clients/async.py":1217
 *                     return None
 *                 except CancelledError:
 *                     raise             # <<<<<<<<<<<<<<
 *                 except Exception,e:
 *                     return e
 */
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_3);
        __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; 
        __PYX_ERR(0, 1217, __pyx_L9_except_error)
      }

      /* "chorde/clients/async.py":1218
 *                 except CancelledError:
 *                     raise
 *                 except Exception,e:             # <<<<<<<<<<<<<<
 *                     return e
 * 
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("chorde.clients.async.Future.exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 1218, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_e = __pyx_t_4;

        /* "chorde/clients/async.py":1219
 *                     raise
 *                 except Exception,e:
 *                     return e             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_e);
        __pyx_r = __pyx_v_e;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L10_except_return;
      }
      goto __pyx_L9_except_error;
      __pyx_L9_except_error:;

      /* "chorde/clients/async.py":1213
 *                 raise CancelledError
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.result()
 *                     return None
 */
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L11_try_return:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L0;
      __pyx_L10_except_return:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L0;
    }
  }

  /* "chorde/clients/async.py":1195
 *                         raise TimeoutError
 * 
 *         def exception(self, timeout=None):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation resulted in an exception, return the exception object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.Future.exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1222
 * 
 * 
 * def makeFutureWrapper(base):             # <<<<<<<<<<<<<<
 *     """
 *     Nice utility function to create Future wrappers. If using a library
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_5makeFutureWrapper(PyObject *__pyx_self, PyObject *__pyx_v_base); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_4makeFutureWrapper[] = "\n    Nice utility function to create Future wrappers. If using a library\n    with concurrent-compatible futures, but not quite the same, and the library\n    checks for inheritance instead of relying on duck typing, then you'll\n    need to make such a class and wrap chorde's futures with it.\n    ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_5makeFutureWrapper = {"makeFutureWrapper", (PyCFunction)__pyx_pw_6chorde_7clients_5async_5makeFutureWrapper, METH_O, __pyx_doc_6chorde_7clients_5async_4makeFutureWrapper};
static PyObject *__pyx_pw_6chorde_7clients_5async_5makeFutureWrapper(PyObject *__pyx_self, PyObject *__pyx_v_base) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("makeFutureWrapper (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_4makeFutureWrapper(__pyx_self, ((PyObject *)__pyx_v_base));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1230
 *     """
 *     class WrapperFuture(base):
 *         def __init__(self, wrapped):             # <<<<<<<<<<<<<<
 *             self.__wrapped = wrapped
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_wrapped = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wrapped,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrapped)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1230, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1230, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_wrapped = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1230, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper.WrapperFuture.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture___init__(__pyx_self, __pyx_v_self, __pyx_v_wrapped);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wrapped) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":1231
 *     class WrapperFuture(base):
 *         def __init__(self, wrapped):
 *             self.__wrapped = wrapped             # <<<<<<<<<<<<<<
 * 
 *         for name, fn in vars(base).iteritems():
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_WrapperFuture__wrapped, __pyx_v_wrapped) < 0) __PYX_ERR(0, 1231, __pyx_L1_error)

  /* "chorde/clients/async.py":1230
 *     """
 *     class WrapperFuture(base):
 *         def __init__(self, wrapped):             # <<<<<<<<<<<<<<
 *             self.__wrapped = wrapped
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper.WrapperFuture.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1235
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):             # <<<<<<<<<<<<<<
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf = {"mkf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_fn = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mkf (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,&__pyx_n_s_fn,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mkf", 1, 2, 2, 1); __PYX_ERR(0, 1235, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mkf") < 0)) __PYX_ERR(0, 1235, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_name = values[0];
    __pyx_v_fn = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mkf", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1235, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper.WrapperFuture.mkf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_2mkf(__pyx_self, __pyx_v_name, __pyx_v_fn);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1237
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):             # <<<<<<<<<<<<<<
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 *                     return f
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_1f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_1f = {"f", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_1f, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_1f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("f (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_p = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_p)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_p);
  } else {
    __pyx_v_p = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "f") < 0)) __PYX_ERR(0, 1237, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("f", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1237, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_p); __pyx_v_p = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper.WrapperFuture.mkf.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_f(__pyx_self, __pyx_v_self, __pyx_v_p, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_f(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_kw) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("f", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1238
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 *                         return getattr(self.__wrapped, name)(*p, **kw)             # <<<<<<<<<<<<<<
 *                     return f
 *                 locals()[name] = mkf(name, fn)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_WrapperFuture__wrapped); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1238, __pyx_L1_error) }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_name;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetAttr(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_p, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1237
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):             # <<<<<<<<<<<<<<
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 *                     return f
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper.WrapperFuture.mkf.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1235
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):             # <<<<<<<<<<<<<<
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_2mkf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_fn) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *__pyx_cur_scope;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mkf", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_9_mkf(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_9_mkf, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1235, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);

  /* "chorde/clients/async.py":1236
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)             # <<<<<<<<<<<<<<
 *                     def f(self, *p, **kw):
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_fn) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fn);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1237
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):             # <<<<<<<<<<<<<<
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 *                     return f
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf_1f, 0, __pyx_n_s_makeFutureWrapper_locals_Wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1239
 *                     def f(self, *p, **kw):
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 *                     return f             # <<<<<<<<<<<<<<
 *                 locals()[name] = mkf(name, fn)
 *         del name, fn
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_f);
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1235
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):             # <<<<<<<<<<<<<<
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper.WrapperFuture.mkf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1222
 * 
 * 
 * def makeFutureWrapper(base):             # <<<<<<<<<<<<<<
 *     """
 *     Nice utility function to create Future wrappers. If using a library
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_4makeFutureWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_WrapperFuture = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("makeFutureWrapper", 0);

  /* "chorde/clients/async.py":1229
 *     need to make such a class and wrap chorde's futures with it.
 *     """
 *     class WrapperFuture(base):             # <<<<<<<<<<<<<<
 *         def __init__(self, wrapped):
 *             self.__wrapped = wrapped
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_base);
  __Pyx_GIVEREF(__pyx_v_base);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_base);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_WrapperFuture, __pyx_n_s_makeFutureWrapper_locals_Wrapper_2, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "chorde/clients/async.py":1230
 *     """
 *     class WrapperFuture(base):
 *         def __init__(self, wrapped):             # <<<<<<<<<<<<<<
 *             self.__wrapped = wrapped
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_1__init__, 0, __pyx_n_s_makeFutureWrapper_locals_Wrapper_3, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1233
 *             self.__wrapped = wrapped
 * 
 *         for name, fn in vars(base).iteritems():             # <<<<<<<<<<<<<<
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):
 */
  __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_vars, __pyx_v_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (unlikely(__pyx_t_8 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(0, 1233, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_dict_iterator(__pyx_t_8, 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_XDECREF(__pyx_t_4);
  __pyx_t_4 = __pyx_t_9;
  __pyx_t_9 = 0;
  while (1) {
    __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_9, &__pyx_t_8, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_10 == 0)) break;
    if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_name_2, __pyx_t_9) < 0) __PYX_ERR(0, 1233, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_fn, __pyx_t_8) < 0) __PYX_ERR(0, 1233, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "chorde/clients/async.py":1234
 * 
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):             # <<<<<<<<<<<<<<
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)
 */
    __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_name_2);
    if (unlikely(!__pyx_t_9)) {
      PyErr_Clear();
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_name_2);
    }
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_startswith); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_9, __pyx_n_s__29) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_n_s__29);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_14 = ((!__pyx_t_13) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_11 = __pyx_t_14;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_fn);
    if (unlikely(!__pyx_t_8)) {
      PyErr_Clear();
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_fn);
    }
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = __Pyx_PyCallable_Check(__pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_13 = (__pyx_t_14 != 0);
    __pyx_t_11 = __pyx_t_13;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_11) {

      /* "chorde/clients/async.py":1235
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):             # <<<<<<<<<<<<<<
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 */
      __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_3mkf, 0, __pyx_n_s_makeFutureWrapper_locals_Wrapper_4, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mkf, __pyx_t_8) < 0) __PYX_ERR(0, 1235, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "chorde/clients/async.py":1240
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 *                     return f
 *                 locals()[name] = mkf(name, fn)             # <<<<<<<<<<<<<<
 *         del name, fn
 *     return WrapperFuture
 */
      __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_name_2);
      if (unlikely(!__pyx_t_8)) {
        PyErr_Clear();
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_name_2);
      }
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_fn);
      if (unlikely(!__pyx_t_12)) {
        PyErr_Clear();
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_fn);
      }
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_mkf);
      if (unlikely(!__pyx_t_9)) {
        PyErr_Clear();
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_mkf);
      }
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_15 = __pyx_pf_6chorde_7clients_5async_17makeFutureWrapper_13WrapperFuture_2mkf(__pyx_t_9, __pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_name_2);
      if (unlikely(!__pyx_t_9)) {
        PyErr_Clear();
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_name_2);
      }
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_9, __pyx_t_15) < 0)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "chorde/clients/async.py":1234
 * 
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):             # <<<<<<<<<<<<<<
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)
 */
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1241
 *                     return f
 *                 locals()[name] = mkf(name, fn)
 *         del name, fn             # <<<<<<<<<<<<<<
 *     return WrapperFuture
 * 
 */
  if (unlikely(PyObject_DelItem(__pyx_t_3, __pyx_n_s_name_2) < 0)) { if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); PyErr_Format(PyExc_NameError, "name '%s' is not defined", "name"); } __PYX_ERR(0, 1241, __pyx_L1_error) }
  if (unlikely(PyObject_DelItem(__pyx_t_3, __pyx_n_s_fn) < 0)) { if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); PyErr_Format(PyExc_NameError, "name '%s' is not defined", "fn"); } __PYX_ERR(0, 1241, __pyx_L1_error) }

  /* "chorde/clients/async.py":1229
 *     need to make such a class and wrap chorde's futures with it.
 *     """
 *     class WrapperFuture(base):             # <<<<<<<<<<<<<<
 *         def __init__(self, wrapped):
 *             self.__wrapped = wrapped
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_WrapperFuture, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_WrapperFuture = __pyx_t_4;
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1242
 *                 locals()[name] = mkf(name, fn)
 *         del name, fn
 *     return WrapperFuture             # <<<<<<<<<<<<<<
 * 
 * class AsyncCacheProcessorThreadPool(ThreadPool):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_WrapperFuture);
  __pyx_r = __pyx_v_WrapperFuture;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1222
 * 
 * 
 * def makeFutureWrapper(base):             # <<<<<<<<<<<<<<
 *     """
 *     Nice utility function to create Future wrappers. If using a library
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("chorde.clients.async.makeFutureWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_WrapperFuture);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1249
 *     Process = AsyncCacheProcessorThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_workers = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_workers,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1249, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1249, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_workers = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1249, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessorThreadPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool___init__(__pyx_self, __pyx_v_self, __pyx_v_workers);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers) {
  PyObject *__pyx_v_current = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":1250
 * 
 *     def __init__(self, workers):
 *         if ThreadPool is multiprocessing.pool.ThreadPool:             # <<<<<<<<<<<<<<
 *             # This patches ThreadPool, which is broken when instanced
 *             # from inside a DummyThread (happens after forking)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_1 == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":1253
 *             # This patches ThreadPool, which is broken when instanced
 *             # from inside a DummyThread (happens after forking)
 *             current = multiprocessing.dummy.current_process()             # <<<<<<<<<<<<<<
 *             if not hasattr(current, '_children'):
 *                 current._children = weakref.WeakKeyDictionary()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_current_process); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_current = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "chorde/clients/async.py":1254
 *             # from inside a DummyThread (happens after forking)
 *             current = multiprocessing.dummy.current_process()
 *             if not hasattr(current, '_children'):             # <<<<<<<<<<<<<<
 *                 current._children = weakref.WeakKeyDictionary()
 *         ThreadPool.__init__(self, workers)
 */
    __pyx_t_5 = __Pyx_HasAttr(__pyx_v_current, __pyx_n_s_children); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1254, __pyx_L1_error)
    __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":1255
 *             current = multiprocessing.dummy.current_process()
 *             if not hasattr(current, '_children'):
 *                 current._children = weakref.WeakKeyDictionary()             # <<<<<<<<<<<<<<
 *         ThreadPool.__init__(self, workers)
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_weakref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_current, __pyx_n_s_children, __pyx_t_2) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "chorde/clients/async.py":1254
 *             # from inside a DummyThread (happens after forking)
 *             current = multiprocessing.dummy.current_process()
 *             if not hasattr(current, '_children'):             # <<<<<<<<<<<<<<
 *                 current._children = weakref.WeakKeyDictionary()
 *         ThreadPool.__init__(self, workers)
 */
    }

    /* "chorde/clients/async.py":1250
 * 
 *     def __init__(self, workers):
 *         if ThreadPool is multiprocessing.pool.ThreadPool:             # <<<<<<<<<<<<<<
 *             # This patches ThreadPool, which is broken when instanced
 *             # from inside a DummyThread (happens after forking)
 */
  }

  /* "chorde/clients/async.py":1256
 *             if not hasattr(current, '_children'):
 *                 current._children = weakref.WeakKeyDictionary()
 *         ThreadPool.__init__(self, workers)             # <<<<<<<<<<<<<<
 * 
 * class ProcessorStats(object):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_workers};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_workers};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_workers);
    __Pyx_GIVEREF(__pyx_v_workers);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_workers);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1249
 *     Process = AsyncCacheProcessorThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessorThreadPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1271
 *         'task_time_max',
 *     )
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_14ProcessorStats_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6chorde_7clients_5async_14ProcessorStats_1__init__, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_14ProcessorStats___init__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":1272
 *     )
 *     def __init__(self):
 *         self.reset()             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1271
 *         'task_time_max',
 *     )
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1274
 *         self.reset()
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0
 *         self.wait_time_sum = self.task_time_sum = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_3reset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_14ProcessorStats_3reset = {"reset", (PyCFunction)__pyx_pw_6chorde_7clients_5async_14ProcessorStats_3reset, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_3reset(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_14ProcessorStats_2reset(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_2reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "chorde/clients/async.py":1275
 * 
 *     def reset(self):
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0             # <<<<<<<<<<<<<<
 *         self.wait_time_sum = self.task_time_sum = 0
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_queued, __pyx_int_0) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_started, __pyx_int_0) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_cancelled, __pyx_int_0) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_completed, __pyx_int_0) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)

  /* "chorde/clients/async.py":1276
 *     def reset(self):
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0
 *         self.wait_time_sum = self.task_time_sum = 0             # <<<<<<<<<<<<<<
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_sum, __pyx_int_0) < 0) __PYX_ERR(0, 1276, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_time_sum, __pyx_int_0) < 0) __PYX_ERR(0, 1276, __pyx_L1_error)

  /* "chorde/clients/async.py":1277
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0
 *         self.wait_time_sum = self.task_time_sum = 0
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None             # <<<<<<<<<<<<<<
 * 
 *     def on_task_queued(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_min, Py_None) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_max, Py_None) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_time_min, Py_None) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_time_max, Py_None) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)

  /* "chorde/clients/async.py":1274
 *         self.reset()
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0
 *         self.wait_time_sum = self.task_time_sum = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1279
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None
 * 
 *     def on_task_queued(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued += 1
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_5on_task_queued(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_14ProcessorStats_5on_task_queued = {"on_task_queued", (PyCFunction)__pyx_pw_6chorde_7clients_5async_14ProcessorStats_5on_task_queued, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_5on_task_queued(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_task_queued (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_14ProcessorStats_4on_task_queued(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_4on_task_queued(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_task_queued", 0);

  /* "chorde/clients/async.py":1280
 * 
 *     def on_task_queued(self):
 *         self.tasks_queued += 1             # <<<<<<<<<<<<<<
 * 
 *     def on_task_cancelled(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tasks_queued); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_queued, __pyx_t_2) < 0) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1279
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None
 * 
 *     def on_task_queued(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued += 1
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.on_task_queued", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1282
 *         self.tasks_queued += 1
 * 
 *     def on_task_cancelled(self):             # <<<<<<<<<<<<<<
 *         self.tasks_cancelled += 1
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_7on_task_cancelled(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_14ProcessorStats_7on_task_cancelled = {"on_task_cancelled", (PyCFunction)__pyx_pw_6chorde_7clients_5async_14ProcessorStats_7on_task_cancelled, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_7on_task_cancelled(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_task_cancelled (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_14ProcessorStats_6on_task_cancelled(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_6on_task_cancelled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_task_cancelled", 0);

  /* "chorde/clients/async.py":1283
 * 
 *     def on_task_cancelled(self):
 *         self.tasks_cancelled += 1             # <<<<<<<<<<<<<<
 * 
 *     def on_task_started(self, wait_time):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tasks_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_cancelled, __pyx_t_2) < 0) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1282
 *         self.tasks_queued += 1
 * 
 *     def on_task_cancelled(self):             # <<<<<<<<<<<<<<
 *         self.tasks_cancelled += 1
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.on_task_cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1285
 *         self.tasks_cancelled += 1
 * 
 *     def on_task_started(self, wait_time):             # <<<<<<<<<<<<<<
 *         self.tasks_started += 1
 *         self.wait_time_sum += wait_time
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_9on_task_started(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_14ProcessorStats_9on_task_started = {"on_task_started", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_14ProcessorStats_9on_task_started, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_9on_task_started(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_wait_time = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_task_started (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wait_time,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wait_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_task_started", 1, 2, 2, 1); __PYX_ERR(0, 1285, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_task_started") < 0)) __PYX_ERR(0, 1285, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_wait_time = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_task_started", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1285, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.on_task_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_14ProcessorStats_8on_task_started(__pyx_self, __pyx_v_self, __pyx_v_wait_time);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_8on_task_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wait_time) {
  PyObject *__pyx_v_wait_time_min = NULL;
  PyObject *__pyx_v_wait_time_max = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_task_started", 0);

  /* "chorde/clients/async.py":1286
 * 
 *     def on_task_started(self, wait_time):
 *         self.tasks_started += 1             # <<<<<<<<<<<<<<
 *         self.wait_time_sum += wait_time
 *         wait_time_min = self.wait_time_min
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tasks_started); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_started, __pyx_t_2) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1287
 *     def on_task_started(self, wait_time):
 *         self.tasks_started += 1
 *         self.wait_time_sum += wait_time             # <<<<<<<<<<<<<<
 *         wait_time_min = self.wait_time_min
 *         if wait_time_min is None or wait_time_min > wait_time:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_wait_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_sum, __pyx_t_1) < 0) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1288
 *         self.tasks_started += 1
 *         self.wait_time_sum += wait_time
 *         wait_time_min = self.wait_time_min             # <<<<<<<<<<<<<<
 *         if wait_time_min is None or wait_time_min > wait_time:
 *             self.wait_time_min = wait_time
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wait_time_min = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1289
 *         self.wait_time_sum += wait_time
 *         wait_time_min = self.wait_time_min
 *         if wait_time_min is None or wait_time_min > wait_time:             # <<<<<<<<<<<<<<
 *             self.wait_time_min = wait_time
 *         wait_time_max = self.wait_time_max
 */
  __pyx_t_4 = (__pyx_v_wait_time_min == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_wait_time_min, __pyx_v_wait_time, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1290
 *         wait_time_min = self.wait_time_min
 *         if wait_time_min is None or wait_time_min > wait_time:
 *             self.wait_time_min = wait_time             # <<<<<<<<<<<<<<
 *         wait_time_max = self.wait_time_max
 *         if wait_time_max is None or wait_time_max < wait_time:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_min, __pyx_v_wait_time) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)

    /* "chorde/clients/async.py":1289
 *         self.wait_time_sum += wait_time
 *         wait_time_min = self.wait_time_min
 *         if wait_time_min is None or wait_time_min > wait_time:             # <<<<<<<<<<<<<<
 *             self.wait_time_min = wait_time
 *         wait_time_max = self.wait_time_max
 */
  }

  /* "chorde/clients/async.py":1291
 *         if wait_time_min is None or wait_time_min > wait_time:
 *             self.wait_time_min = wait_time
 *         wait_time_max = self.wait_time_max             # <<<<<<<<<<<<<<
 *         if wait_time_max is None or wait_time_max < wait_time:
 *             self.wait_time_max = wait_time
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wait_time_max = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1292
 *             self.wait_time_min = wait_time
 *         wait_time_max = self.wait_time_max
 *         if wait_time_max is None or wait_time_max < wait_time:             # <<<<<<<<<<<<<<
 *             self.wait_time_max = wait_time
 * 
 */
  __pyx_t_5 = (__pyx_v_wait_time_max == Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_wait_time_max, __pyx_v_wait_time, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1293
 *         wait_time_max = self.wait_time_max
 *         if wait_time_max is None or wait_time_max < wait_time:
 *             self.wait_time_max = wait_time             # <<<<<<<<<<<<<<
 * 
 *     def on_task_completed(self, task_time):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wait_time_max, __pyx_v_wait_time) < 0) __PYX_ERR(0, 1293, __pyx_L1_error)

    /* "chorde/clients/async.py":1292
 *             self.wait_time_min = wait_time
 *         wait_time_max = self.wait_time_max
 *         if wait_time_max is None or wait_time_max < wait_time:             # <<<<<<<<<<<<<<
 *             self.wait_time_max = wait_time
 * 
 */
  }

  /* "chorde/clients/async.py":1285
 *         self.tasks_cancelled += 1
 * 
 *     def on_task_started(self, wait_time):             # <<<<<<<<<<<<<<
 *         self.tasks_started += 1
 *         self.wait_time_sum += wait_time
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.on_task_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wait_time_min);
  __Pyx_XDECREF(__pyx_v_wait_time_max);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1295
 *             self.wait_time_max = wait_time
 * 
 *     def on_task_completed(self, task_time):             # <<<<<<<<<<<<<<
 *         self.tasks_completed += 1
 *         self.task_time_sum += task_time
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_11on_task_completed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_14ProcessorStats_11on_task_completed = {"on_task_completed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_14ProcessorStats_11on_task_completed, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_14ProcessorStats_11on_task_completed(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_task_time = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_task_completed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_task_time,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_task_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_task_completed", 1, 2, 2, 1); __PYX_ERR(0, 1295, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_task_completed") < 0)) __PYX_ERR(0, 1295, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_task_time = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_task_completed", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1295, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.on_task_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_14ProcessorStats_10on_task_completed(__pyx_self, __pyx_v_self, __pyx_v_task_time);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_14ProcessorStats_10on_task_completed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task_time) {
  PyObject *__pyx_v_task_time_min = NULL;
  PyObject *__pyx_v_task_time_max = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("on_task_completed", 0);

  /* "chorde/clients/async.py":1296
 * 
 *     def on_task_completed(self, task_time):
 *         self.tasks_completed += 1             # <<<<<<<<<<<<<<
 *         self.task_time_sum += task_time
 *         task_time_min = self.task_time_min
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tasks_completed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tasks_completed, __pyx_t_2) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":1297
 *     def on_task_completed(self, task_time):
 *         self.tasks_completed += 1
 *         self.task_time_sum += task_time             # <<<<<<<<<<<<<<
 *         task_time_min = self.task_time_min
 *         if task_time_min is None or task_time_min > task_time:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_task_time_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_task_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_time_sum, __pyx_t_1) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1298
 *         self.tasks_completed += 1
 *         self.task_time_sum += task_time
 *         task_time_min = self.task_time_min             # <<<<<<<<<<<<<<
 *         if task_time_min is None or task_time_min > task_time:
 *             self.task_time_min = task_time
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_task_time_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_task_time_min = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1299
 *         self.task_time_sum += task_time
 *         task_time_min = self.task_time_min
 *         if task_time_min is None or task_time_min > task_time:             # <<<<<<<<<<<<<<
 *             self.task_time_min = task_time
 *         task_time_max = self.task_time_max
 */
  __pyx_t_4 = (__pyx_v_task_time_min == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_task_time_min, __pyx_v_task_time, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1300
 *         task_time_min = self.task_time_min
 *         if task_time_min is None or task_time_min > task_time:
 *             self.task_time_min = task_time             # <<<<<<<<<<<<<<
 *         task_time_max = self.task_time_max
 *         if task_time_max is None or task_time_max < task_time:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_time_min, __pyx_v_task_time) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)

    /* "chorde/clients/async.py":1299
 *         self.task_time_sum += task_time
 *         task_time_min = self.task_time_min
 *         if task_time_min is None or task_time_min > task_time:             # <<<<<<<<<<<<<<
 *             self.task_time_min = task_time
 *         task_time_max = self.task_time_max
 */
  }

  /* "chorde/clients/async.py":1301
 *         if task_time_min is None or task_time_min > task_time:
 *             self.task_time_min = task_time
 *         task_time_max = self.task_time_max             # <<<<<<<<<<<<<<
 *         if task_time_max is None or task_time_max < task_time:
 *             self.task_time_max = task_time
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_task_time_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_task_time_max = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1302
 *             self.task_time_min = task_time
 *         task_time_max = self.task_time_max
 *         if task_time_max is None or task_time_max < task_time:             # <<<<<<<<<<<<<<
 *             self.task_time_max = task_time
 * 
 */
  __pyx_t_5 = (__pyx_v_task_time_max == Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_task_time_max, __pyx_v_task_time, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1303
 *         task_time_max = self.task_time_max
 *         if task_time_max is None or task_time_max < task_time:
 *             self.task_time_max = task_time             # <<<<<<<<<<<<<<
 * 
 * class AsyncCacheProcessor(object):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_task_time_max, __pyx_v_task_time) < 0) __PYX_ERR(0, 1303, __pyx_L1_error)

    /* "chorde/clients/async.py":1302
 *             self.task_time_min = task_time
 *         task_time_max = self.task_time_max
 *         if task_time_max is None or task_time_max < task_time:             # <<<<<<<<<<<<<<
 *             self.task_time_max = task_time
 * 
 */
  }

  /* "chorde/clients/async.py":1295
 *             self.wait_time_max = wait_time
 * 
 *     def on_task_completed(self, task_time):             # <<<<<<<<<<<<<<
 *         self.tasks_completed += 1
 *         self.task_time_sum += task_time
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.ProcessorStats.on_task_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_task_time_min);
  __Pyx_XDECREF(__pyx_v_task_time_max);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1326
 *     """
 * 
 *     def __init__(self, workers, client,             # <<<<<<<<<<<<<<
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_workers = 0;
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_coalescence_buffer_size = 0;
  PyObject *__pyx_v_maxqueue = 0;
  PyObject *__pyx_v_cleanup_cycles = 0;
  PyObject *__pyx_v_threadpool = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_workers,&__pyx_n_s_client,&__pyx_n_s_coalescence_buffer_size,&__pyx_n_s_maxqueue,&__pyx_n_s_cleanup_cycles,&__pyx_n_s_threadpool,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)__pyx_int_500));

    /* "chorde/clients/async.py":1327
 * 
 *     def __init__(self, workers, client,
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,             # <<<<<<<<<<<<<<
 *             threadpool = None):
 *         self.client = client
 */
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_500));

    /* "chorde/clients/async.py":1328
 *     def __init__(self, workers, client,
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):             # <<<<<<<<<<<<<<
 *         self.client = client
 *         self.logger = logging.getLogger("chorde")
 */
    values[6] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_workers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 1); __PYX_ERR(0, 1326, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 2); __PYX_ERR(0, 1326, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coalescence_buffer_size);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxqueue);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cleanup_cycles);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threadpool);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1326, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_workers = values[1];
    __pyx_v_client = values[2];
    __pyx_v_coalescence_buffer_size = values[3];
    __pyx_v_maxqueue = values[4];
    __pyx_v_cleanup_cycles = values[5];
    __pyx_v_threadpool = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1326, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor___init__(__pyx_self, __pyx_v_self, __pyx_v_workers, __pyx_v_client, __pyx_v_coalescence_buffer_size, __pyx_v_maxqueue, __pyx_v_cleanup_cycles, __pyx_v_threadpool);

  /* "chorde/clients/async.py":1326
 *     """
 * 
 *     def __init__(self, workers, client,             # <<<<<<<<<<<<<<
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_workers, PyObject *__pyx_v_client, PyObject *__pyx_v_coalescence_buffer_size, PyObject *__pyx_v_maxqueue, PyObject *__pyx_v_cleanup_cycles, PyObject *__pyx_v_threadpool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":1329
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.logger = logging.getLogger("chorde")
 *         self.workers = workers
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 1329, __pyx_L1_error)

  /* "chorde/clients/async.py":1330
 *             threadpool = None):
 *         self.client = client
 *         self.logger = logging.getLogger("chorde")             # <<<<<<<<<<<<<<
 *         self.workers = workers
 *         self.maxqueue = maxqueue
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_s_chorde) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_chorde);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1331
 *         self.client = client
 *         self.logger = logging.getLogger("chorde")
 *         self.workers = workers             # <<<<<<<<<<<<<<
 *         self.maxqueue = maxqueue
 *         self._wself = weakref.ref(self)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_workers, __pyx_v_workers) < 0) __PYX_ERR(0, 1331, __pyx_L1_error)

  /* "chorde/clients/async.py":1332
 *         self.logger = logging.getLogger("chorde")
 *         self.workers = workers
 *         self.maxqueue = maxqueue             # <<<<<<<<<<<<<<
 *         self._wself = weakref.ref(self)
 *         if callable(threadpool):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxqueue, __pyx_v_maxqueue) < 0) __PYX_ERR(0, 1332, __pyx_L1_error)

  /* "chorde/clients/async.py":1333
 *         self.workers = workers
 *         self.maxqueue = maxqueue
 *         self._wself = weakref.ref(self)             # <<<<<<<<<<<<<<
 *         if callable(threadpool):
 *             self._threadpool_factory = threadpool
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_weakref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wself, __pyx_t_1) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1334
 *         self.maxqueue = maxqueue
 *         self._wself = weakref.ref(self)
 *         if callable(threadpool):             # <<<<<<<<<<<<<<
 *             self._threadpool_factory = threadpool
 *             self._threadpool = None
 */
  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_threadpool); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1334, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "chorde/clients/async.py":1335
 *         self._wself = weakref.ref(self)
 *         if callable(threadpool):
 *             self._threadpool_factory = threadpool             # <<<<<<<<<<<<<<
 *             self._threadpool = None
 *         else:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_factory, __pyx_v_threadpool) < 0) __PYX_ERR(0, 1335, __pyx_L1_error)

    /* "chorde/clients/async.py":1336
 *         if callable(threadpool):
 *             self._threadpool_factory = threadpool
 *             self._threadpool = None             # <<<<<<<<<<<<<<
 *         else:
 *             self._threadpool_factory = None
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2, Py_None) < 0) __PYX_ERR(0, 1336, __pyx_L1_error)

    /* "chorde/clients/async.py":1334
 *         self.maxqueue = maxqueue
 *         self._wself = weakref.ref(self)
 *         if callable(threadpool):             # <<<<<<<<<<<<<<
 *             self._threadpool_factory = threadpool
 *             self._threadpool = None
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1338
 *             self._threadpool = None
 *         else:
 *             self._threadpool_factory = None             # <<<<<<<<<<<<<<
 *             self._threadpool = threadpool
 *         self._spawnlock = threading.Lock()
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_factory, Py_None) < 0) __PYX_ERR(0, 1338, __pyx_L1_error)

    /* "chorde/clients/async.py":1339
 *         else:
 *             self._threadpool_factory = None
 *             self._threadpool = threadpool             # <<<<<<<<<<<<<<
 *         self._spawnlock = threading.Lock()
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2, __pyx_v_threadpool) < 0) __PYX_ERR(0, 1339, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1340
 *             self._threadpool_factory = None
 *             self._threadpool = threadpool
 *         self._spawnlock = threading.Lock()             # <<<<<<<<<<<<<<
 * 
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spawnlock, __pyx_t_1) < 0) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1342
 *         self._spawnlock = threading.Lock()
 * 
 *         self.coalesce_get = Cache(coalescence_buffer_size)             # <<<<<<<<<<<<<<
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)
 *         self.coalesce_contains = Cache(coalescence_buffer_size)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_coalescence_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_coalescence_buffer_size);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_get, __pyx_t_1) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1343
 * 
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)             # <<<<<<<<<<<<<<
 *         self.coalesce_contains = Cache(coalescence_buffer_size)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_coalescence_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_coalescence_buffer_size);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_getTtl, __pyx_t_1) < 0) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1344
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)
 *         self.coalesce_contains = Cache(coalescence_buffer_size)             # <<<<<<<<<<<<<<
 * 
 *         self.tl = threading.local()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_coalescence_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_coalescence_buffer_size);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_contains, __pyx_t_1) < 0) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1346
 *         self.coalesce_contains = Cache(coalescence_buffer_size)
 * 
 *         self.tl = threading.local()             # <<<<<<<<<<<<<<
 *         self.cleanup_tasks = []
 *         self.cleanup_cycles = cleanup_cycles
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_local); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tl, __pyx_t_1) < 0) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1347
 * 
 *         self.tl = threading.local()
 *         self.cleanup_tasks = []             # <<<<<<<<<<<<<<
 *         self.cleanup_cycles = cleanup_cycles
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_tasks, __pyx_t_1) < 0) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1348
 *         self.tl = threading.local()
 *         self.cleanup_tasks = []
 *         self.cleanup_cycles = cleanup_cycles             # <<<<<<<<<<<<<<
 * 
 *         self._tit_tat = itertools.cycle(iter((True,False))).next
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_cycles, __pyx_v_cleanup_cycles) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)

  /* "chorde/clients/async.py":1350
 *         self.cleanup_cycles = cleanup_cycles
 * 
 *         self._tit_tat = itertools.cycle(iter((True,False))).next             # <<<<<<<<<<<<<<
 * 
 *         self.stats = ProcessorStats()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_itertools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cycle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetIter(__pyx_tuple__32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_next); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tit_tat, __pyx_t_3) < 0) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "chorde/clients/async.py":1352
 *         self._tit_tat = itertools.cycle(iter((True,False))).next
 * 
 *         self.stats = ProcessorStats()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ProcessorStats); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_stats, __pyx_t_3) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "chorde/clients/async.py":1326
 *     """
 * 
 *     def __init__(self, workers, client,             # <<<<<<<<<<<<<<
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1355
 * 
 *     @property
 *     def threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._threadpool is None:
 *             with self._spawnlock:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_3threadpool(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_3threadpool = {"threadpool", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_3threadpool, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_3threadpool(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("threadpool (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_2threadpool(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_2threadpool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("threadpool", 0);

  /* "chorde/clients/async.py":1356
 *     @property
 *     def threadpool(self):
 *         if self._threadpool is None:             # <<<<<<<<<<<<<<
 *             with self._spawnlock:
 *                 if self._threadpool is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1357
 *     def threadpool(self):
 *         if self._threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._threadpool is None:
 *                     if self._threadpool_factory is not None:
 */
    /*with:*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spawnlock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1357, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {

            /* "chorde/clients/async.py":1358
 *         if self._threadpool is None:
 *             with self._spawnlock:
 *                 if self._threadpool is None:             # <<<<<<<<<<<<<<
 *                     if self._threadpool_factory is not None:
 *                         self._threadpool = self._threadpool_factory(self.workers)
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = (__pyx_t_1 == Py_None);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {

              /* "chorde/clients/async.py":1359
 *             with self._spawnlock:
 *                 if self._threadpool is None:
 *                     if self._threadpool_factory is not None:             # <<<<<<<<<<<<<<
 *                         self._threadpool = self._threadpool_factory(self.workers)
 *                     else:
 */
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_factory); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = (__pyx_t_1 != Py_None);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_3 = (__pyx_t_2 != 0);
              if (__pyx_t_3) {

                /* "chorde/clients/async.py":1360
 *                 if self._threadpool is None:
 *                     if self._threadpool_factory is not None:
 *                         self._threadpool = self._threadpool_factory(self.workers)             # <<<<<<<<<<<<<<
 *                     else:
 *                         self._threadpool = AsyncCacheProcessorThreadPool(self.workers)
 */
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_factory); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1360, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1360, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_5, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 1360, __pyx_L8_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                /* "chorde/clients/async.py":1359
 *             with self._spawnlock:
 *                 if self._threadpool is None:
 *                     if self._threadpool_factory is not None:             # <<<<<<<<<<<<<<
 *                         self._threadpool = self._threadpool_factory(self.workers)
 *                     else:
 */
                goto __pyx_L15;
              }

              /* "chorde/clients/async.py":1362
 *                         self._threadpool = self._threadpool_factory(self.workers)
 *                     else:
 *                         self._threadpool = AsyncCacheProcessorThreadPool(self.workers)             # <<<<<<<<<<<<<<
 *         return self._threadpool
 * 
 */
              /*else*/ {
                __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AsyncCacheProcessorThreadPool); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_workers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1362, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_5, function);
                  }
                }
                __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2, __pyx_t_1) < 0) __PYX_ERR(0, 1362, __pyx_L8_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __pyx_L15:;

              /* "chorde/clients/async.py":1358
 *         if self._threadpool is None:
 *             with self._spawnlock:
 *                 if self._threadpool is None:             # <<<<<<<<<<<<<<
 *                     if self._threadpool_factory is not None:
 *                         self._threadpool = self._threadpool_factory(self.workers)
 */
            }

            /* "chorde/clients/async.py":1357
 *     def threadpool(self):
 *         if self._threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._threadpool is None:
 *                     if self._threadpool_factory is not None:
 */
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L13_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.threadpool", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1357, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_7 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1357, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1357, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (__pyx_t_3 < 0) __PYX_ERR(0, 1357, __pyx_L10_except_error)
            __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
            if (__pyx_t_2) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_5, __pyx_t_6);
              __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; 
              __PYX_ERR(0, 1357, __pyx_L10_except_error)
            }
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          __pyx_L13_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_4) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1357, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "chorde/clients/async.py":1356
 *     @property
 *     def threadpool(self):
 *         if self._threadpool is None:             # <<<<<<<<<<<<<<
 *             with self._spawnlock:
 *                 if self._threadpool is None:
 */
  }

  /* "chorde/clients/async.py":1363
 *                     else:
 *                         self._threadpool = AsyncCacheProcessorThreadPool(self.workers)
 *         return self._threadpool             # <<<<<<<<<<<<<<
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1355
 * 
 *     @property
 *     def threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._threadpool is None:
 *             with self._spawnlock:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.threadpool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1365
 *         return self._threadpool
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):             # <<<<<<<<<<<<<<
 *         logger = self.logger
 *         cfuture = future = Future(logger)
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_coalesce_key);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_coalesce_key);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_coalesce_key);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_5_enqueue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_5_enqueue = {"_enqueue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_5_enqueue, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_5_enqueue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_action = 0;
  PyObject *__pyx_v_coalesce = 0;
  PyObject *__pyx_v_coalesce_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_enqueue (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_action,&__pyx_n_s_coalesce_2,&__pyx_n_s_coalesce_key,0};
    PyObject* values[4] = {0,0,0,0};
    __pyx_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = __pyx_dynamic_args->__pyx_arg_coalesce_key;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_action)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_enqueue", 0, 2, 4, 1); __PYX_ERR(0, 1365, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coalesce_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coalesce_key);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_enqueue") < 0)) __PYX_ERR(0, 1365, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_action = values[1];
    __pyx_v_coalesce = values[2];
    __pyx_v_coalesce_key = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_enqueue", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1365, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_4_enqueue(__pyx_self, __pyx_v_self, __pyx_v_action, __pyx_v_coalesce, __pyx_v_coalesce_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1398
 *                 stats = self.stats
 *                 queue_time = time.time()
 *                 def wrapped_action():             # <<<<<<<<<<<<<<
 *                     def clean_coalesce():
 *                         if do_coalescence:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_1wrapped_action(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_1wrapped_action = {"wrapped_action", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_1wrapped_action, METH_NOARGS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_1wrapped_action(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrapped_action (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_wrapped_action(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1399
 *                 queue_time = time.time()
 *                 def wrapped_action():
 *                     def clean_coalesce():             # <<<<<<<<<<<<<<
 *                         if do_coalescence:
 *                             try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_1clean_coalesce(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_1clean_coalesce = {"clean_coalesce", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_1clean_coalesce, METH_NOARGS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_1clean_coalesce(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clean_coalesce (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(PyObject *__pyx_self) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clean_coalesce", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1400
 *                 def wrapped_action():
 *                     def clean_coalesce():
 *                         if do_coalescence:             # <<<<<<<<<<<<<<
 *                             try:
 *                                 del coalesce[coalesce_key]
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_do_coalescence)) { __Pyx_RaiseClosureNameError("do_coalescence"); __PYX_ERR(0, 1400, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_do_coalescence); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":1401
 *                     def clean_coalesce():
 *                         if do_coalescence:
 *                             try:             # <<<<<<<<<<<<<<
 *                                 del coalesce[coalesce_key]
 *                             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "chorde/clients/async.py":1402
 *                         if do_coalescence:
 *                             try:
 *                                 del coalesce[coalesce_key]             # <<<<<<<<<<<<<<
 *                             except:
 *                                 pass
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_coalesce)) { __Pyx_RaiseClosureNameError("coalesce"); __PYX_ERR(0, 1402, __pyx_L4_error) }
        if (unlikely(!__pyx_cur_scope->__pyx_v_coalesce_key)) { __Pyx_RaiseClosureNameError("coalesce_key"); __PYX_ERR(0, 1402, __pyx_L4_error) }
        if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_coalesce, __pyx_cur_scope->__pyx_v_coalesce_key) < 0)) __PYX_ERR(0, 1402, __pyx_L4_error)

        /* "chorde/clients/async.py":1401
 *                     def clean_coalesce():
 *                         if do_coalescence:
 *                             try:             # <<<<<<<<<<<<<<
 *                                 del coalesce[coalesce_key]
 *                             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;

      /* "chorde/clients/async.py":1403
 *                             try:
 *                                 del coalesce[coalesce_key]
 *                             except:             # <<<<<<<<<<<<<<
 *                                 pass
 * 
 */
      /*except:*/ {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L5_exception_handled;
      }
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L9_try_end:;
    }

    /* "chorde/clients/async.py":1400
 *                 def wrapped_action():
 *                     def clean_coalesce():
 *                         if do_coalescence:             # <<<<<<<<<<<<<<
 *                             try:
 *                                 del coalesce[coalesce_key]
 */
  }

  /* "chorde/clients/async.py":1399
 *                 queue_time = time.time()
 *                 def wrapped_action():
 *                     def clean_coalesce():             # <<<<<<<<<<<<<<
 *                         if do_coalescence:
 *                             try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue.wrapped_action.clean_coalesce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1406
 *                                 pass
 * 
 *                     def clean(self):             # <<<<<<<<<<<<<<
 *                         if self is not None:
 *                             try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_3clean(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_3clean = {"clean", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_3clean, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_3clean(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clean (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_2clean(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_2clean(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_outer_scope;
  PyObject *__pyx_v_tl = NULL;
  PyObject *__pyx_v_task = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clean", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1407
 * 
 *                     def clean(self):
 *                         if self is not None:             # <<<<<<<<<<<<<<
 *                             try:
 *                                 tl = self.tl
 */
  __pyx_t_1 = (__pyx_v_self != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":1408
 *                     def clean(self):
 *                         if self is not None:
 *                             try:             # <<<<<<<<<<<<<<
 *                                 tl = self.tl
 *                                 if not hasattr(tl, 'dirty_rounds'):
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "chorde/clients/async.py":1409
 *                         if self is not None:
 *                             try:
 *                                 tl = self.tl             # <<<<<<<<<<<<<<
 *                                 if not hasattr(tl, 'dirty_rounds'):
 *                                     tl.dirty_rounds = 0
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_v_tl = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "chorde/clients/async.py":1410
 *                             try:
 *                                 tl = self.tl
 *                                 if not hasattr(tl, 'dirty_rounds'):             # <<<<<<<<<<<<<<
 *                                     tl.dirty_rounds = 0
 *                                 tl.dirty_rounds += 1
 */
        __pyx_t_2 = __Pyx_HasAttr(__pyx_v_tl, __pyx_n_s_dirty_rounds); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1410, __pyx_L4_error)
        __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
        if (__pyx_t_1) {

          /* "chorde/clients/async.py":1411
 *                                 tl = self.tl
 *                                 if not hasattr(tl, 'dirty_rounds'):
 *                                     tl.dirty_rounds = 0             # <<<<<<<<<<<<<<
 *                                 tl.dirty_rounds += 1
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_tl, __pyx_n_s_dirty_rounds, __pyx_int_0) < 0) __PYX_ERR(0, 1411, __pyx_L4_error)

          /* "chorde/clients/async.py":1410
 *                             try:
 *                                 tl = self.tl
 *                                 if not hasattr(tl, 'dirty_rounds'):             # <<<<<<<<<<<<<<
 *                                     tl.dirty_rounds = 0
 *                                 tl.dirty_rounds += 1
 */
        }

        /* "chorde/clients/async.py":1412
 *                                 if not hasattr(tl, 'dirty_rounds'):
 *                                     tl.dirty_rounds = 0
 *                                 tl.dirty_rounds += 1             # <<<<<<<<<<<<<<
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:
 *                                     tl.dirty_rounds = 0
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tl, __pyx_n_s_dirty_rounds); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1412, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1412, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_tl, __pyx_n_s_dirty_rounds, __pyx_t_7) < 0) __PYX_ERR(0, 1412, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":1413
 *                                     tl.dirty_rounds = 0
 *                                 tl.dirty_rounds += 1
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:             # <<<<<<<<<<<<<<
 *                                     tl.dirty_rounds = 0
 *                                     for task in self.cleanup_tasks:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tl, __pyx_n_s_dirty_rounds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1413, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_cycles); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1413, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1413, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1413, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!__pyx_t_2) {
        } else {
          __pyx_t_1 = __pyx_t_2;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queuelen); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1413, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1413, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = ((!__pyx_t_2) != 0);
        __pyx_t_1 = __pyx_t_9;
        __pyx_L12_bool_binop_done:;
        if (__pyx_t_1) {

          /* "chorde/clients/async.py":1414
 *                                 tl.dirty_rounds += 1
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:
 *                                     tl.dirty_rounds = 0             # <<<<<<<<<<<<<<
 *                                     for task in self.cleanup_tasks:
 *                                         task()
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_tl, __pyx_n_s_dirty_rounds, __pyx_int_0) < 0) __PYX_ERR(0, 1414, __pyx_L4_error)

          /* "chorde/clients/async.py":1415
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:
 *                                     tl.dirty_rounds = 0
 *                                     for task in self.cleanup_tasks:             # <<<<<<<<<<<<<<
 *                                         task()
 *                                     for task in _global_cleanup_tasks:
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_tasks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1415, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
            __pyx_t_6 = __pyx_t_8; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
            __pyx_t_11 = NULL;
          } else {
            __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1415, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1415, __pyx_L4_error)
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          for (;;) {
            if (likely(!__pyx_t_11)) {
              if (likely(PyList_CheckExact(__pyx_t_6))) {
                if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1415, __pyx_L4_error)
                #else
                __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1415, __pyx_L4_error)
                __Pyx_GOTREF(__pyx_t_8);
                #endif
              } else {
                if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1415, __pyx_L4_error)
                #else
                __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1415, __pyx_L4_error)
                __Pyx_GOTREF(__pyx_t_8);
                #endif
              }
            } else {
              __pyx_t_8 = __pyx_t_11(__pyx_t_6);
              if (unlikely(!__pyx_t_8)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 1415, __pyx_L4_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_8);
            }
            __Pyx_XDECREF_SET(__pyx_v_task, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "chorde/clients/async.py":1416
 *                                     tl.dirty_rounds = 0
 *                                     for task in self.cleanup_tasks:
 *                                         task()             # <<<<<<<<<<<<<<
 *                                     for task in _global_cleanup_tasks:
 *                                         task()
 */
            __Pyx_INCREF(__pyx_v_task);
            __pyx_t_7 = __pyx_v_task; __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_7, function);
              }
            }
            __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1416, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "chorde/clients/async.py":1415
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:
 *                                     tl.dirty_rounds = 0
 *                                     for task in self.cleanup_tasks:             # <<<<<<<<<<<<<<
 *                                         task()
 *                                     for task in _global_cleanup_tasks:
 */
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "chorde/clients/async.py":1417
 *                                     for task in self.cleanup_tasks:
 *                                         task()
 *                                     for task in _global_cleanup_tasks:             # <<<<<<<<<<<<<<
 *                                         task()
 *                             except:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_global_cleanup_tasks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
            __pyx_t_8 = __pyx_t_6; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
            __pyx_t_11 = NULL;
          } else {
            __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1417, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1417, __pyx_L4_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          for (;;) {
            if (likely(!__pyx_t_11)) {
              if (likely(PyList_CheckExact(__pyx_t_8))) {
                if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1417, __pyx_L4_error)
                #else
                __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L4_error)
                __Pyx_GOTREF(__pyx_t_6);
                #endif
              } else {
                if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1417, __pyx_L4_error)
                #else
                __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L4_error)
                __Pyx_GOTREF(__pyx_t_6);
                #endif
              }
            } else {
              __pyx_t_6 = __pyx_t_11(__pyx_t_8);
              if (unlikely(!__pyx_t_6)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 1417, __pyx_L4_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_XDECREF_SET(__pyx_v_task, __pyx_t_6);
            __pyx_t_6 = 0;

            /* "chorde/clients/async.py":1418
 *                                         task()
 *                                     for task in _global_cleanup_tasks:
 *                                         task()             # <<<<<<<<<<<<<<
 *                             except:
 *                                 logger.error("Error during background thread cleanup", exc_info = True)
 */
            __Pyx_INCREF(__pyx_v_task);
            __pyx_t_7 = __pyx_v_task; __pyx_t_12 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_7, function);
              }
            }
            __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1418, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "chorde/clients/async.py":1417
 *                                     for task in self.cleanup_tasks:
 *                                         task()
 *                                     for task in _global_cleanup_tasks:             # <<<<<<<<<<<<<<
 *                                         task()
 *                             except:
 */
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "chorde/clients/async.py":1413
 *                                     tl.dirty_rounds = 0
 *                                 tl.dirty_rounds += 1
 *                                 if tl.dirty_rounds > self.cleanup_cycles or not self.queuelen:             # <<<<<<<<<<<<<<
 *                                     tl.dirty_rounds = 0
 *                                     for task in self.cleanup_tasks:
 */
        }

        /* "chorde/clients/async.py":1408
 *                     def clean(self):
 *                         if self is not None:
 *                             try:             # <<<<<<<<<<<<<<
 *                                 tl = self.tl
 *                                 if not hasattr(tl, 'dirty_rounds'):
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "chorde/clients/async.py":1419
 *                                     for task in _global_cleanup_tasks:
 *                                         task()
 *                             except:             # <<<<<<<<<<<<<<
 *                                 logger.error("Error during background thread cleanup", exc_info = True)
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue.wrapped_action.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1419, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);

        /* "chorde/clients/async.py":1420
 *                                         task()
 *                             except:
 *                                 logger.error("Error during background thread cleanup", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *                     # discard queue head quickly when we're overloaded
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_logger)) { __Pyx_RaiseClosureNameError("logger"); __PYX_ERR(0, 1420, __pyx_L6_except_error) }
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_logger, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1420, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1420, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_exc_info, Py_True) < 0) __PYX_ERR(0, 1420, __pyx_L6_except_error)
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__33, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1420, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L5_exception_handled;
      }
      __pyx_L6_except_error:;

      /* "chorde/clients/async.py":1408
 *                     def clean(self):
 *                         if self is not None:
 *                             try:             # <<<<<<<<<<<<<<
 *                                 tl = self.tl
 *                                 if not hasattr(tl, 'dirty_rounds'):
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L9_try_end:;
    }

    /* "chorde/clients/async.py":1407
 * 
 *                     def clean(self):
 *                         if self is not None:             # <<<<<<<<<<<<<<
 *                             try:
 *                                 tl = self.tl
 */
  }

  /* "chorde/clients/async.py":1406
 *                                 pass
 * 
 *                     def clean(self):             # <<<<<<<<<<<<<<
 *                         if self is not None:
 *                             try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue.wrapped_action.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tl);
  __Pyx_XDECREF(__pyx_v_task);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1398
 *                 stats = self.stats
 *                 queue_time = time.time()
 *                 def wrapped_action():             # <<<<<<<<<<<<<<
 *                     def clean_coalesce():
 *                         if do_coalescence:
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_wrapped_action(PyObject *__pyx_self) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_cur_scope;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_outer_scope;
  PyObject *__pyx_v_clean_coalesce = 0;
  PyObject *__pyx_v_clean = 0;
  PyObject *__pyx_v_self = NULL;
  int __pyx_v_cleaned_coalesce;
  PyObject *__pyx_v_start_time = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrapped_action", 0);
  __pyx_outer_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "chorde/clients/async.py":1399
 *                 queue_time = time.time()
 *                 def wrapped_action():
 *                     def clean_coalesce():             # <<<<<<<<<<<<<<
 *                         if do_coalescence:
 *                             try:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_1clean_coalesce, 0, __pyx_n_s_AsyncCacheProcessor__enqueue_loc, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_clean_coalesce = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1406
 *                                 pass
 * 
 *                     def clean(self):             # <<<<<<<<<<<<<<
 *                         if self is not None:
 *                             try:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_3clean, 0, __pyx_n_s_AsyncCacheProcessor__enqueue_loc_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_clean = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1424
 *                     # discard queue head quickly when we're overloaded
 *                     # head is always less relevant
 *                     self = wself()             # <<<<<<<<<<<<<<
 *                     cleaned_coalesce = False
 *                     try:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_wself)) { __Pyx_RaiseClosureNameError("wself"); __PYX_ERR(0, 1424, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_wself);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_wself; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1425
 *                     # head is always less relevant
 *                     self = wself()
 *                     cleaned_coalesce = False             # <<<<<<<<<<<<<<
 *                     try:
 *                         if self is not None and maxqueue is not None:
 */
  __pyx_v_cleaned_coalesce = 0;

  /* "chorde/clients/async.py":1426
 *                     self = wself()
 *                     cleaned_coalesce = False
 *                     try:             # <<<<<<<<<<<<<<
 *                         if self is not None and maxqueue is not None:
 *                             if self.queuelen > maxqueue:
 */
  /*try:*/ {

    /* "chorde/clients/async.py":1427
 *                     cleaned_coalesce = False
 *                     try:
 *                         if self is not None and maxqueue is not None:             # <<<<<<<<<<<<<<
 *                             if self.queuelen > maxqueue:
 *                                 # Only discard half the entries, otherwise we can
 */
    __pyx_t_5 = (__pyx_v_self != Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_4 = __pyx_t_6;
      goto __pyx_L7_bool_binop_done;
    }
    if (unlikely(!__pyx_cur_scope->__pyx_v_maxqueue)) { __Pyx_RaiseClosureNameError("maxqueue"); __PYX_ERR(0, 1427, __pyx_L4_error) }
    __pyx_t_6 = (__pyx_cur_scope->__pyx_v_maxqueue != Py_None);
    __pyx_t_5 = (__pyx_t_6 != 0);
    __pyx_t_4 = __pyx_t_5;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":1428
 *                     try:
 *                         if self is not None and maxqueue is not None:
 *                             if self.queuelen > maxqueue:             # <<<<<<<<<<<<<<
 *                                 # Only discard half the entries, otherwise we can
 *                                 # enter a race condition in which really fast input
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queuelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(!__pyx_cur_scope->__pyx_v_maxqueue)) { __Pyx_RaiseClosureNameError("maxqueue"); __PYX_ERR(0, 1428, __pyx_L4_error) }
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_maxqueue, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1428, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":1432
 *                                 # enter a race condition in which really fast input
 *                                 # to the processor keeps the queue full and discarding all
 *                                 if self._tit_tat():             # <<<<<<<<<<<<<<
 *                                     cfuture.cancel()
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tit_tat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1432, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (__pyx_t_4) {

          /* "chorde/clients/async.py":1433
 *                                 # to the processor keeps the queue full and discarding all
 *                                 if self._tit_tat():
 *                                     cfuture.cancel()             # <<<<<<<<<<<<<<
 * 
 *                         if cfuture.set_running_or_notify_cancelled():
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_cfuture)) { __Pyx_RaiseClosureNameError("cfuture"); __PYX_ERR(0, 1433, __pyx_L4_error) }
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cfuture, __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "chorde/clients/async.py":1432
 *                                 # enter a race condition in which really fast input
 *                                 # to the processor keeps the queue full and discarding all
 *                                 if self._tit_tat():             # <<<<<<<<<<<<<<
 *                                     cfuture.cancel()
 * 
 */
        }

        /* "chorde/clients/async.py":1428
 *                     try:
 *                         if self is not None and maxqueue is not None:
 *                             if self.queuelen > maxqueue:             # <<<<<<<<<<<<<<
 *                                 # Only discard half the entries, otherwise we can
 *                                 # enter a race condition in which really fast input
 */
      }

      /* "chorde/clients/async.py":1427
 *                     cleaned_coalesce = False
 *                     try:
 *                         if self is not None and maxqueue is not None:             # <<<<<<<<<<<<<<
 *                             if self.queuelen > maxqueue:
 *                                 # Only discard half the entries, otherwise we can
 */
    }

    /* "chorde/clients/async.py":1435
 *                                     cfuture.cancel()
 * 
 *                         if cfuture.set_running_or_notify_cancelled():             # <<<<<<<<<<<<<<
 *                             start_time = time.time()
 *                             stats.on_task_started(start_time - queue_time)
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_cfuture)) { __Pyx_RaiseClosureNameError("cfuture"); __PYX_ERR(0, 1435, __pyx_L4_error) }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cfuture, __pyx_n_s_set_running_or_notify_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1435, __pyx_L4_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":1436
 * 
 *                         if cfuture.set_running_or_notify_cancelled():
 *                             start_time = time.time()             # <<<<<<<<<<<<<<
 *                             stats.on_task_started(start_time - queue_time)
 *                             try:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_start_time = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "chorde/clients/async.py":1437
 *                         if cfuture.set_running_or_notify_cancelled():
 *                             start_time = time.time()
 *                             stats.on_task_started(start_time - queue_time)             # <<<<<<<<<<<<<<
 *                             try:
 *                                 rv = action()
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_stats)) { __Pyx_RaiseClosureNameError("stats"); __PYX_ERR(0, 1437, __pyx_L4_error) }
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s_on_task_started); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(!__pyx_cur_scope->__pyx_v_queue_time)) { __Pyx_RaiseClosureNameError("queue_time"); __PYX_ERR(0, 1437, __pyx_L4_error) }
      __pyx_t_1 = PyNumber_Subtract(__pyx_v_start_time, __pyx_cur_scope->__pyx_v_queue_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "chorde/clients/async.py":1438
 *                             start_time = time.time()
 *                             stats.on_task_started(start_time - queue_time)
 *                             try:             # <<<<<<<<<<<<<<
 *                                 rv = action()
 *                                 clean_coalesce()
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "chorde/clients/async.py":1439
 *                             stats.on_task_started(start_time - queue_time)
 *                             try:
 *                                 rv = action()             # <<<<<<<<<<<<<<
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_action)) { __Pyx_RaiseClosureNameError("action"); __PYX_ERR(0, 1439, __pyx_L12_error) }
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_action);
          __pyx_t_3 = __pyx_cur_scope->__pyx_v_action; __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_rv = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "chorde/clients/async.py":1440
 *                             try:
 *                                 rv = action()
 *                                 clean_coalesce()             # <<<<<<<<<<<<<<
 *                                 cleaned_coalesce = True
 *                                 cfuture.set(rv)
 */
          __pyx_t_2 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_v_clean_coalesce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "chorde/clients/async.py":1441
 *                                 rv = action()
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True             # <<<<<<<<<<<<<<
 *                                 cfuture.set(rv)
 *                             except CacheMissError:
 */
          __pyx_v_cleaned_coalesce = 1;

          /* "chorde/clients/async.py":1442
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True
 *                                 cfuture.set(rv)             # <<<<<<<<<<<<<<
 *                             except CacheMissError:
 *                                 clean_coalesce()
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_cfuture)) { __Pyx_RaiseClosureNameError("cfuture"); __PYX_ERR(0, 1442, __pyx_L12_error) }
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cfuture, __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1442, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_rv) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rv);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1442, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "chorde/clients/async.py":1438
 *                             start_time = time.time()
 *                             stats.on_task_started(start_time - queue_time)
 *                             try:             # <<<<<<<<<<<<<<
 *                                 rv = action()
 *                                 clean_coalesce()
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L17_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":1443
 *                                 cleaned_coalesce = True
 *                                 cfuture.set(rv)
 *                             except CacheMissError:             # <<<<<<<<<<<<<<
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True
 */
        __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1);
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1443, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_1);
        __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0;
        if (__pyx_t_11) {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue.wrapped_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 1443, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);

          /* "chorde/clients/async.py":1444
 *                                 cfuture.set(rv)
 *                             except CacheMissError:
 *                                 clean_coalesce()             # <<<<<<<<<<<<<<
 *                                 cleaned_coalesce = True
 *                                 cfuture.miss()
 */
          __pyx_t_7 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_v_clean_coalesce); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1444, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":1445
 *                             except CacheMissError:
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True             # <<<<<<<<<<<<<<
 *                                 cfuture.miss()
 *                             except:
 */
          __pyx_v_cleaned_coalesce = 1;

          /* "chorde/clients/async.py":1446
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True
 *                                 cfuture.miss()             # <<<<<<<<<<<<<<
 *                             except:
 *                                 clean_coalesce()
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_cfuture)) { __Pyx_RaiseClosureNameError("cfuture"); __PYX_ERR(0, 1446, __pyx_L14_except_error) }
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cfuture, __pyx_n_s_miss); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1446, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          __pyx_t_7 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L13_exception_handled;
        }

        /* "chorde/clients/async.py":1447
 *                                 cleaned_coalesce = True
 *                                 cfuture.miss()
 *                             except:             # <<<<<<<<<<<<<<
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True
 */
        /*except:*/ {
          __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue.wrapped_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 1447, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_1);

          /* "chorde/clients/async.py":1448
 *                                 cfuture.miss()
 *                             except:
 *                                 clean_coalesce()             # <<<<<<<<<<<<<<
 *                                 cleaned_coalesce = True
 *                                 # Clear up traceback to avoid leaks
 */
          __pyx_t_7 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_v_clean_coalesce); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1448, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":1449
 *                             except:
 *                                 clean_coalesce()
 *                                 cleaned_coalesce = True             # <<<<<<<<<<<<<<
 *                                 # Clear up traceback to avoid leaks
 *                                 cfuture.exc(sys.exc_info()[:-1] + (None,))
 */
          __pyx_v_cleaned_coalesce = 1;

          /* "chorde/clients/async.py":1451
 *                                 cleaned_coalesce = True
 *                                 # Clear up traceback to avoid leaks
 *                                 cfuture.exc(sys.exc_info()[:-1] + (None,))             # <<<<<<<<<<<<<<
 *                             stats.on_task_completed(time.time() - start_time)
 *                         else:
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_cfuture)) { __Pyx_RaiseClosureNameError("cfuture"); __PYX_ERR(0, 1451, __pyx_L14_except_error) }
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cfuture, __pyx_n_s_exc); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_15 = __Pyx_PyObject_GetSlice(__pyx_t_13, 0, -1L, NULL, NULL, &__pyx_slice__37, 0, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyNumber_Add(__pyx_t_15, __pyx_tuple__38); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_15 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_15, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L13_exception_handled;
        }
        __pyx_L14_except_error:;

        /* "chorde/clients/async.py":1438
 *                             start_time = time.time()
 *                             stats.on_task_started(start_time - queue_time)
 *                             try:             # <<<<<<<<<<<<<<
 *                                 rv = action()
 *                                 clean_coalesce()
 */
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L4_error;
        __pyx_L13_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L17_try_end:;
      }

      /* "chorde/clients/async.py":1452
 *                                 # Clear up traceback to avoid leaks
 *                                 cfuture.exc(sys.exc_info()[:-1] + (None,))
 *                             stats.on_task_completed(time.time() - start_time)             # <<<<<<<<<<<<<<
 *                         else:
 *                             clean_coalesce()
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_stats)) { __Pyx_RaiseClosureNameError("stats"); __PYX_ERR(0, 1452, __pyx_L4_error) }
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s_on_task_completed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1452, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1452, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Subtract(__pyx_t_2, __pyx_v_start_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1452, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":1435
 *                                     cfuture.cancel()
 * 
 *                         if cfuture.set_running_or_notify_cancelled():             # <<<<<<<<<<<<<<
 *                             start_time = time.time()
 *                             stats.on_task_started(start_time - queue_time)
 */
      goto __pyx_L11;
    }

    /* "chorde/clients/async.py":1454
 *                             stats.on_task_completed(time.time() - start_time)
 *                         else:
 *                             clean_coalesce()             # <<<<<<<<<<<<<<
 *                             cleaned_coalesce = True
 *                             stats.on_task_cancelled()
 */
    /*else*/ {
      __pyx_t_1 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_v_clean_coalesce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":1455
 *                         else:
 *                             clean_coalesce()
 *                             cleaned_coalesce = True             # <<<<<<<<<<<<<<
 *                             stats.on_task_cancelled()
 *                     finally:
 */
      __pyx_v_cleaned_coalesce = 1;

      /* "chorde/clients/async.py":1456
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 *                             stats.on_task_cancelled()             # <<<<<<<<<<<<<<
 *                     finally:
 *                         # Just in case, we really need to clean, or we leak cfutures
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_stats)) { __Pyx_RaiseClosureNameError("stats"); __PYX_ERR(0, 1456, __pyx_L4_error) }
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s_on_task_cancelled); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1456, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L11:;
  }

  /* "chorde/clients/async.py":1459
 *                     finally:
 *                         # Just in case, we really need to clean, or we leak cfutures
 *                         if not cleaned_coalesce:             # <<<<<<<<<<<<<<
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_4 = ((!(__pyx_v_cleaned_coalesce != 0)) != 0);
      if (__pyx_t_4) {

        /* "chorde/clients/async.py":1460
 *                         # Just in case, we really need to clean, or we leak cfutures
 *                         if not cleaned_coalesce:
 *                             clean_coalesce()             # <<<<<<<<<<<<<<
 *                             cleaned_coalesce = True
 *                         clean(self)
 */
        __pyx_t_1 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_v_clean_coalesce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "chorde/clients/async.py":1461
 *                         if not cleaned_coalesce:
 *                             clean_coalesce()
 *                             cleaned_coalesce = True             # <<<<<<<<<<<<<<
 *                         clean(self)
 *                 self.threadpool.apply_async(wrapped_action, ())
 */
        __pyx_v_cleaned_coalesce = 1;

        /* "chorde/clients/async.py":1459
 *                     finally:
 *                         # Just in case, we really need to clean, or we leak cfutures
 *                         if not cleaned_coalesce:             # <<<<<<<<<<<<<<
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 */
      }

      /* "chorde/clients/async.py":1462
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 *                         clean(self)             # <<<<<<<<<<<<<<
 *                 self.threadpool.apply_async(wrapped_action, ())
 *                 stats.on_task_queued()
 */
      __pyx_t_1 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_2clean(__pyx_v_clean, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __pyx_t_11 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
      {

        /* "chorde/clients/async.py":1459
 *                     finally:
 *                         # Just in case, we really need to clean, or we leak cfutures
 *                         if not cleaned_coalesce:             # <<<<<<<<<<<<<<
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 */
        __pyx_t_4 = ((!(__pyx_v_cleaned_coalesce != 0)) != 0);
        if (__pyx_t_4) {

          /* "chorde/clients/async.py":1460
 *                         # Just in case, we really need to clean, or we leak cfutures
 *                         if not cleaned_coalesce:
 *                             clean_coalesce()             # <<<<<<<<<<<<<<
 *                             cleaned_coalesce = True
 *                         clean(self)
 */
          __pyx_t_1 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_clean_coalesce(__pyx_v_clean_coalesce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "chorde/clients/async.py":1461
 *                         if not cleaned_coalesce:
 *                             clean_coalesce()
 *                             cleaned_coalesce = True             # <<<<<<<<<<<<<<
 *                         clean(self)
 *                 self.threadpool.apply_async(wrapped_action, ())
 */
          __pyx_v_cleaned_coalesce = 1;

          /* "chorde/clients/async.py":1459
 *                     finally:
 *                         # Just in case, we really need to clean, or we leak cfutures
 *                         if not cleaned_coalesce:             # <<<<<<<<<<<<<<
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 */
        }

        /* "chorde/clients/async.py":1462
 *                             clean_coalesce()
 *                             cleaned_coalesce = True
 *                         clean(self)             # <<<<<<<<<<<<<<
 *                 self.threadpool.apply_async(wrapped_action, ())
 *                 stats.on_task_queued()
 */
        __pyx_t_1 = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_14wrapped_action_2clean(__pyx_v_clean, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      }
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
      goto __pyx_L1_error;
      __pyx_L24_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "chorde/clients/async.py":1398
 *                 stats = self.stats
 *                 queue_time = time.time()
 *                 def wrapped_action():             # <<<<<<<<<<<<<<
 *                     def clean_coalesce():
 *                         if do_coalescence:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue.wrapped_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_clean_coalesce);
  __Pyx_XDECREF(__pyx_v_clean);
  __Pyx_XDECREF(__pyx_v_self);
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1365
 *         return self._threadpool
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):             # <<<<<<<<<<<<<<
 *         logger = self.logger
 *         cfuture = future = Future(logger)
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_4_enqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_action, PyObject *__pyx_v_coalesce, PyObject *__pyx_v_coalesce_key) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_cur_scope;
  PyObject *__pyx_v_future = NULL;
  PyObject *__pyx_v_waction = NULL;
  PyObject *__pyx_v_cwaction = NULL;
  PyObject *__pyx_v_wrapped_action = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_enqueue", 0);
  __pyx_cur_scope = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *)__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_10__enqueue(__pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_10__enqueue, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1365, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_action = __pyx_v_action;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_action);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_action);
  __pyx_cur_scope->__pyx_v_coalesce = __pyx_v_coalesce;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_coalesce);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_coalesce);
  __pyx_cur_scope->__pyx_v_coalesce_key = __pyx_v_coalesce_key;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_coalesce_key);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_coalesce_key);

  /* "chorde/clients/async.py":1366
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):
 *         logger = self.logger             # <<<<<<<<<<<<<<
 *         cfuture = future = Future(logger)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_logger = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1367
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):
 *         logger = self.logger
 *         cfuture = future = Future(logger)             # <<<<<<<<<<<<<<
 * 
 *         do_coalescence = coalesce is not None and coalesce_key is not NONE
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Future); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_logger) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_logger);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_cfuture = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_future = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1369
 *         cfuture = future = Future(logger)
 * 
 *         do_coalescence = coalesce is not None and coalesce_key is not NONE             # <<<<<<<<<<<<<<
 *         if do_coalescence:
 *             waction = weakref.ref(action)
 */
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_coalesce != Py_None);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_coalesce_key != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_do_coalescence = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1370
 * 
 *         do_coalescence = coalesce is not None and coalesce_key is not NONE
 *         if do_coalescence:             # <<<<<<<<<<<<<<
 *             waction = weakref.ref(action)
 *             cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_do_coalescence); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1370, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "chorde/clients/async.py":1371
 *         do_coalescence = coalesce is not None and coalesce_key is not NONE
 *         if do_coalescence:
 *             waction = weakref.ref(action)             # <<<<<<<<<<<<<<
 *             cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 *             if cfuture is not future and cwaction() is None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_weakref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_action) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_action);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_waction = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":1372
 *         if do_coalescence:
 *             waction = weakref.ref(action)
 *             cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))             # <<<<<<<<<<<<<<
 *             if cfuture is not future and cwaction() is None:
 *                 # Dead action, discard, reinsert
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_coalesce, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_future);
    __Pyx_GIVEREF(__pyx_v_future);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_future);
    __Pyx_INCREF(__pyx_v_waction);
    __Pyx_GIVEREF(__pyx_v_waction);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_waction);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_coalesce_key, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_coalesce_key, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_coalesce_key);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_coalesce_key);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_coalesce_key);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1372, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1372, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1372, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_cfuture);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_cfuture, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_v_cwaction = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "chorde/clients/async.py":1373
 *             waction = weakref.ref(action)
 *             cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 *             if cfuture is not future and cwaction() is None:             # <<<<<<<<<<<<<<
 *                 # Dead action, discard, reinsert
 *                 cfuture = future
 */
    __pyx_t_9 = (__pyx_cur_scope->__pyx_v_cfuture != __pyx_v_future);
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_4 = __pyx_t_10;
      goto __pyx_L9_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_v_cwaction);
    __pyx_t_7 = __pyx_v_cwaction; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = (__pyx_t_1 == Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__pyx_t_10 != 0);
    __pyx_t_4 = __pyx_t_9;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_4) {

      /* "chorde/clients/async.py":1375
 *             if cfuture is not future and cwaction() is None:
 *                 # Dead action, discard, reinsert
 *                 cfuture = future             # <<<<<<<<<<<<<<
 *                 try:
 *                     del coalesce[coalesce_key]
 */
      __Pyx_INCREF(__pyx_v_future);
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_cfuture);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_cfuture, __pyx_v_future);
      __Pyx_GIVEREF(__pyx_v_future);

      /* "chorde/clients/async.py":1376
 *                 # Dead action, discard, reinsert
 *                 cfuture = future
 *                 try:             # <<<<<<<<<<<<<<
 *                     del coalesce[coalesce_key]
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {

          /* "chorde/clients/async.py":1377
 *                 cfuture = future
 *                 try:
 *                     del coalesce[coalesce_key]             # <<<<<<<<<<<<<<
 *                 except:
 *                     pass
 */
          if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_coalesce, __pyx_cur_scope->__pyx_v_coalesce_key) < 0)) __PYX_ERR(0, 1377, __pyx_L11_error)

          /* "chorde/clients/async.py":1376
 *                 # Dead action, discard, reinsert
 *                 cfuture = future
 *                 try:             # <<<<<<<<<<<<<<
 *                     del coalesce[coalesce_key]
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L16_try_end;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "chorde/clients/async.py":1378
 *                 try:
 *                     del coalesce[coalesce_key]
 *                 except:             # <<<<<<<<<<<<<<
 *                     pass
 *                 cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 */
        /*except:*/ {
          __Pyx_ErrRestore(0,0,0);
          goto __pyx_L12_exception_handled;
        }
        __pyx_L12_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        __pyx_L16_try_end:;
      }

      /* "chorde/clients/async.py":1380
 *                 except:
 *                     pass
 *                 cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))             # <<<<<<<<<<<<<<
 *                 logger.warning("Found zombie task in coalesce buffer with key %r", coalesce_key)
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_coalesce, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_future);
      __Pyx_GIVEREF(__pyx_v_future);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_future);
      __Pyx_INCREF(__pyx_v_waction);
      __Pyx_GIVEREF(__pyx_v_waction);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_waction);
      __pyx_t_2 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_coalesce_key, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_coalesce_key, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_coalesce_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_coalesce_key);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_coalesce_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1380, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1380, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L18_unpacking_done;
        __pyx_L17_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1380, __pyx_L1_error)
        __pyx_L18_unpacking_done:;
      }
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_cfuture);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_cfuture, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_cwaction, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "chorde/clients/async.py":1381
 *                     pass
 *                 cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 *                 logger.warning("Found zombie task in coalesce buffer with key %r", coalesce_key)             # <<<<<<<<<<<<<<
 * 
 *         if cfuture is future:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_logger, __pyx_n_s_warning); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Found_zombie_task_in_coalesce_bu, __pyx_cur_scope->__pyx_v_coalesce_key};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Found_zombie_task_in_coalesce_bu, __pyx_cur_scope->__pyx_v_coalesce_key};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_Found_zombie_task_in_coalesce_bu);
        __Pyx_GIVEREF(__pyx_kp_s_Found_zombie_task_in_coalesce_bu);
        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_kp_s_Found_zombie_task_in_coalesce_bu);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_coalesce_key);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_coalesce_key);
        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_coalesce_key);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "chorde/clients/async.py":1373
 *             waction = weakref.ref(action)
 *             cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 *             if cfuture is not future and cwaction() is None:             # <<<<<<<<<<<<<<
 *                 # Dead action, discard, reinsert
 *                 cfuture = future
 */
    }

    /* "chorde/clients/async.py":1370
 * 
 *         do_coalescence = coalesce is not None and coalesce_key is not NONE
 *         if do_coalescence:             # <<<<<<<<<<<<<<
 *             waction = weakref.ref(action)
 *             cfuture, cwaction = coalesce.setdefault(coalesce_key, (future, waction))
 */
  }

  /* "chorde/clients/async.py":1383
 *                 logger.warning("Found zombie task in coalesce buffer with key %r", coalesce_key)
 * 
 *         if cfuture is future:             # <<<<<<<<<<<<<<
 *             maxqueue = self.maxqueue
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):
 */
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_cfuture == __pyx_v_future);
  __pyx_t_9 = (__pyx_t_4 != 0);
  if (__pyx_t_9) {

    /* "chorde/clients/async.py":1384
 * 
 *         if cfuture is future:
 *             maxqueue = self.maxqueue             # <<<<<<<<<<<<<<
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):
 *                 # Stop filling it
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxqueue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_maxqueue = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "chorde/clients/async.py":1385
 *         if cfuture is future:
 *             maxqueue = self.maxqueue
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):             # <<<<<<<<<<<<<<
 *                 # Stop filling it
 *                 if do_coalescence:
 */
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_maxqueue != Py_None);
    __pyx_t_10 = (__pyx_t_4 != 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_9 = __pyx_t_10;
      goto __pyx_L21_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queuelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_maxqueue, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __pyx_t_10;
    __pyx_L21_bool_binop_done:;
    if (__pyx_t_9) {

      /* "chorde/clients/async.py":1387
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):
 *                 # Stop filling it
 *                 if do_coalescence:             # <<<<<<<<<<<<<<
 *                     try:
 *                         del coalesce[coalesce_key]
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_do_coalescence); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1387, __pyx_L1_error)
      if (__pyx_t_9) {

        /* "chorde/clients/async.py":1388
 *                 # Stop filling it
 *                 if do_coalescence:
 *                     try:             # <<<<<<<<<<<<<<
 *                         del coalesce[coalesce_key]
 *                     except:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "chorde/clients/async.py":1389
 *                 if do_coalescence:
 *                     try:
 *                         del coalesce[coalesce_key]             # <<<<<<<<<<<<<<
 *                     except:
 *                         pass
 */
            if (unlikely(PyObject_DelItem(__pyx_cur_scope->__pyx_v_coalesce, __pyx_cur_scope->__pyx_v_coalesce_key) < 0)) __PYX_ERR(0, 1389, __pyx_L24_error)

            /* "chorde/clients/async.py":1388
 *                 # Stop filling it
 *                 if do_coalescence:
 *                     try:             # <<<<<<<<<<<<<<
 *                         del coalesce[coalesce_key]
 *                     except:
 */
          }
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L29_try_end;
          __pyx_L24_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "chorde/clients/async.py":1390
 *                     try:
 *                         del coalesce[coalesce_key]
 *                     except:             # <<<<<<<<<<<<<<
 *                         pass
 *                 cfuture.cancel()
 */
          /*except:*/ {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L25_exception_handled;
          }
          __pyx_L25_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
          __pyx_L29_try_end:;
        }

        /* "chorde/clients/async.py":1387
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):
 *                 # Stop filling it
 *                 if do_coalescence:             # <<<<<<<<<<<<<<
 *                     try:
 *                         del coalesce[coalesce_key]
 */
      }

      /* "chorde/clients/async.py":1392
 *                     except:
 *                         pass
 *                 cfuture.cancel()             # <<<<<<<<<<<<<<
 *             else:
 *                 # I'm the one queueing
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cfuture, __pyx_n_s_cancel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1385
 *         if cfuture is future:
 *             maxqueue = self.maxqueue
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):             # <<<<<<<<<<<<<<
 *                 # Stop filling it
 *                 if do_coalescence:
 */
      goto __pyx_L20;
    }

    /* "chorde/clients/async.py":1395
 *             else:
 *                 # I'm the one queueing
 *                 wself = self._wself             # <<<<<<<<<<<<<<
 *                 stats = self.stats
 *                 queue_time = time.time()
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wself); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1395, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_wself = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1396
 *                 # I'm the one queueing
 *                 wself = self._wself
 *                 stats = self.stats             # <<<<<<<<<<<<<<
 *                 queue_time = time.time()
 *                 def wrapped_action():
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1396, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_stats = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1397
 *                 wself = self._wself
 *                 stats = self.stats
 *                 queue_time = time.time()             # <<<<<<<<<<<<<<
 *                 def wrapped_action():
 *                     def clean_coalesce():
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_queue_time = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1398
 *                 stats = self.stats
 *                 queue_time = time.time()
 *                 def wrapped_action():             # <<<<<<<<<<<<<<
 *                     def clean_coalesce():
 *                         if do_coalescence:
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_8_enqueue_1wrapped_action, 0, __pyx_n_s_AsyncCacheProcessor__enqueue_loc_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_wrapped_action = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1463
 *                             cleaned_coalesce = True
 *                         clean(self)
 *                 self.threadpool.apply_async(wrapped_action, ())             # <<<<<<<<<<<<<<
 *                 stats.on_task_queued()
 *         return cfuture
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_apply_async); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_wrapped_action, __pyx_empty_tuple};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_wrapped_action, __pyx_empty_tuple};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_wrapped_action);
        __Pyx_GIVEREF(__pyx_v_wrapped_action);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_wrapped_action);
        __Pyx_INCREF(__pyx_empty_tuple);
        __Pyx_GIVEREF(__pyx_empty_tuple);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_empty_tuple);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1464
 *                         clean(self)
 *                 self.threadpool.apply_async(wrapped_action, ())
 *                 stats.on_task_queued()             # <<<<<<<<<<<<<<
 *         return cfuture
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s_on_task_queued); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L20:;

    /* "chorde/clients/async.py":1383
 *                 logger.warning("Found zombie task in coalesce buffer with key %r", coalesce_key)
 * 
 *         if cfuture is future:             # <<<<<<<<<<<<<<
 *             maxqueue = self.maxqueue
 *             if maxqueue is not None and self.queuelen > (maxqueue*2):
 */
  }

  /* "chorde/clients/async.py":1465
 *                 self.threadpool.apply_async(wrapped_action, ())
 *                 stats.on_task_queued()
 *         return cfuture             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cfuture);
  __pyx_r = __pyx_cur_scope->__pyx_v_cfuture;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1365
 *         return self._threadpool
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):             # <<<<<<<<<<<<<<
 *         logger = self.logger
 *         cfuture = future = Future(logger)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor._enqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_future);
  __Pyx_XDECREF(__pyx_v_waction);
  __Pyx_XDECREF(__pyx_v_cwaction);
  __Pyx_XDECREF(__pyx_v_wrapped_action);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1468
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_7capacity(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_7capacity = {"capacity", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_7capacity, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_7capacity(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_6capacity(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_6capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("capacity", 0);

  /* "chorde/clients/async.py":1469
 *     @property
 *     def capacity(self):
 *         return self.client.capacity             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1468
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1472
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_9usage(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_9usage = {"usage", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_9usage, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_9usage(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("usage (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8usage(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_8usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("usage", 0);

  /* "chorde/clients/async.py":1473
 *     @property
 *     def usage(self):
 *         return self.client.usage             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_usage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1472
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.usage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1476
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_11queuelen(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_11queuelen = {"queuelen", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_11queuelen, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_11queuelen(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("queuelen (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_10queuelen(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_10queuelen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("queuelen", 0);

  /* "chorde/clients/async.py":1477
 *     @property
 *     def queuelen(self):
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0             # <<<<<<<<<<<<<<
 * 
 *     def do_async(self, func, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((__pyx_t_3 != 0)) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_threadpool_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_taskqueue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_qsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1476
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.queuelen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1479
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_13do_async(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_13do_async = {"do_async", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_13do_async, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_13do_async(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_async (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_async", 0, 2, 2, 1); __PYX_ERR(0, 1479, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "do_async") < 0)) __PYX_ERR(0, 1479, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_async", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1479, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.do_async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_12do_async(__pyx_self, __pyx_v_self, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_12do_async(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_async", 0);

  /* "chorde/clients/async.py":1480
 * 
 *     def do_async(self, func, *args, **kwargs):
 *         return self._enqueue(functools.partial(func, *args, **kwargs))             # <<<<<<<<<<<<<<
 * 
 *     def do_async_coalescent(self, coalesce, coalesce_key, func, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_partial); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_func);
  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1479
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.do_async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1482
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 *     def do_async_coalescent(self, coalesce, coalesce_key, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an already-queued future if there is one, or a new one if not.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_15do_async_coalescent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_14do_async_coalescent[] = "\n        Returns an already-queued future if there is one, or a new one if not.\n\n        Params:\n            coalesce: A coalescence map (dict, Cache, or simialr)\n            coalesce_key: A coalesence key\n\n            See do_async for the rest\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_15do_async_coalescent = {"do_async_coalescent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_15do_async_coalescent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_14do_async_coalescent};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_15do_async_coalescent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_coalesce = 0;
  PyObject *__pyx_v_coalesce_key = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_async_coalescent (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 4) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 4, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_coalesce_2,&__pyx_n_s_coalesce_key,&__pyx_n_s_func,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coalesce_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_async_coalescent", 0, 4, 4, 1); __PYX_ERR(0, 1482, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coalesce_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_async_coalescent", 0, 4, 4, 2); __PYX_ERR(0, 1482, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_async_coalescent", 0, 4, 4, 3); __PYX_ERR(0, 1482, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 4) ? pos_args : 4;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "do_async_coalescent") < 0)) __PYX_ERR(0, 1482, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_coalesce = values[1];
    __pyx_v_coalesce_key = values[2];
    __pyx_v_func = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_async_coalescent", 0, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1482, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.do_async_coalescent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_14do_async_coalescent(__pyx_self, __pyx_v_self, __pyx_v_coalesce, __pyx_v_coalesce_key, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_14do_async_coalescent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_coalesce, PyObject *__pyx_v_coalesce_key, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_async_coalescent", 0);

  /* "chorde/clients/async.py":1492
 *             See do_async for the rest
 *         """
 *         return self._enqueue(functools.partial(func, *args, **kwargs),             # <<<<<<<<<<<<<<
 *             coalesce, coalesce_key)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_partial); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_func);
  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "chorde/clients/async.py":1493
 *         """
 *         return self._enqueue(functools.partial(func, *args, **kwargs),
 *             coalesce, coalesce_key)             # <<<<<<<<<<<<<<
 * 
 *     def bound(self, client):
 */
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_6, __pyx_v_coalesce, __pyx_v_coalesce_key};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_6, __pyx_v_coalesce, __pyx_v_coalesce_key};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_coalesce);
    __Pyx_GIVEREF(__pyx_v_coalesce);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_coalesce);
    __Pyx_INCREF(__pyx_v_coalesce_key);
    __Pyx_GIVEREF(__pyx_v_coalesce_key);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_coalesce_key);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1482
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 *     def do_async_coalescent(self, coalesce, coalesce_key, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an already-queued future if there is one, or a new one if not.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.do_async_coalescent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1495
 *             coalesce, coalesce_key)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a proxy of this processor bound to the specified client instead.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_17bound(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_16bound[] = "\n        Returns a proxy of this processor bound to the specified client instead.\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_17bound = {"bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_17bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_16bound};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_17bound(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_client = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bound (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bound", 1, 2, 2, 1); __PYX_ERR(0, 1495, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bound") < 0)) __PYX_ERR(0, 1495, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_client = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1495, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_16bound(__pyx_self, __pyx_v_self, __pyx_v_client);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_16bound(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bound", 0);

  /* "chorde/clients/async.py":1499
 *         Returns a proxy of this processor bound to the specified client instead.
 *         """
 *         return WrappedCacheProcessor(self, client)             # <<<<<<<<<<<<<<
 * 
 *     def getTtl(self, key, default = NONE, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WrappedCacheProcessor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_client};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_client};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_client);
    __Pyx_GIVEREF(__pyx_v_client);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_client);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1495
 *             coalesce, coalesce_key)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a proxy of this processor bound to the specified client instead.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1501
 *         return WrappedCacheProcessor(self, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_42__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_default);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_19getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_19getTtl = {"getTtl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_19getTtl, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_19getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTtl (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 3, 1); __PYX_ERR(0, 1501, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "getTtl") < 0)) __PYX_ERR(0, 1501, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1501, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_18getTtl(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_18getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_ckey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTtl", 0);

  /* "chorde/clients/async.py":1502
 * 
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):             # <<<<<<<<<<<<<<
 *             if default is NONE:
 *                 ckey = key
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyDict_ViewKeys(__pyx_v_kw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_COALESCE_IGNORE_KWARGS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":1503
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:             # <<<<<<<<<<<<<<
 *                 ckey = key
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = (__pyx_v_default == __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":1504
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 *                 ckey = key             # <<<<<<<<<<<<<<
 *             else:
 *                 ckey = (key, default)
 */
      __Pyx_INCREF(__pyx_v_key);
      __pyx_v_ckey = __pyx_v_key;

      /* "chorde/clients/async.py":1503
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:             # <<<<<<<<<<<<<<
 *                 ckey = key
 *             else:
 */
      goto __pyx_L6;
    }

    /* "chorde/clients/async.py":1506
 *                 ckey = key
 *             else:
 *                 ckey = (key, default)             # <<<<<<<<<<<<<<
 *         else:
 *             ckey = NONE
 */
    /*else*/ {
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key);
      __Pyx_INCREF(__pyx_v_default);
      __Pyx_GIVEREF(__pyx_v_default);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_default);
      __pyx_v_ckey = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_L6:;

    /* "chorde/clients/async.py":1502
 * 
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):             # <<<<<<<<<<<<<<
 *             if default is NONE:
 *                 ckey = key
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1508
 *                 ckey = (key, default)
 *         else:
 *             ckey = NONE             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.getTtl, key, default, **kw),
 *             self.coalesce_getTtl, ckey)
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_ckey = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1509
 *         else:
 *             ckey = NONE
 *         return self._enqueue(functools.partial(self.client.getTtl, key, default, **kw),             # <<<<<<<<<<<<<<
 *             self.coalesce_getTtl, ckey)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_functools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_partial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_default);
  __pyx_t_8 = 0;
  __pyx_t_8 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1510
 *             ckey = NONE
 *         return self._enqueue(functools.partial(self.client.getTtl, key, default, **kw),
 *             self.coalesce_getTtl, ckey)             # <<<<<<<<<<<<<<
 * 
 *     def get(self, key, default = NONE, **kw):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_getTtl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_9, __pyx_t_8, __pyx_v_ckey};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_9, __pyx_t_8, __pyx_v_ckey};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_ckey);
    __Pyx_GIVEREF(__pyx_v_ckey);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_v_ckey);
    __pyx_t_9 = 0;
    __pyx_t_8 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1501
 *         return WrappedCacheProcessor(self, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ckey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1512
 *             self.coalesce_getTtl, ckey)
 * 
 *     def get(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_default);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_21get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_21get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_21get, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_21get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, 1); __PYX_ERR(0, 1512, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "get") < 0)) __PYX_ERR(0, 1512, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1512, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_20get(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_20get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_ckey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "chorde/clients/async.py":1513
 * 
 *     def get(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):             # <<<<<<<<<<<<<<
 *             if default is NONE:
 *                 ckey = key
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyDict_ViewKeys(__pyx_v_kw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_COALESCE_IGNORE_KWARGS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":1514
 *     def get(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:             # <<<<<<<<<<<<<<
 *                 ckey = key
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = (__pyx_v_default == __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "chorde/clients/async.py":1515
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 *                 ckey = key             # <<<<<<<<<<<<<<
 *             else:
 *                 ckey = (key, default)
 */
      __Pyx_INCREF(__pyx_v_key);
      __pyx_v_ckey = __pyx_v_key;

      /* "chorde/clients/async.py":1514
 *     def get(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:             # <<<<<<<<<<<<<<
 *                 ckey = key
 *             else:
 */
      goto __pyx_L6;
    }

    /* "chorde/clients/async.py":1517
 *                 ckey = key
 *             else:
 *                 ckey = (key, default)             # <<<<<<<<<<<<<<
 *         else:
 *             ckey = NONE
 */
    /*else*/ {
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key);
      __Pyx_INCREF(__pyx_v_default);
      __Pyx_GIVEREF(__pyx_v_default);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_default);
      __pyx_v_ckey = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_L6:;

    /* "chorde/clients/async.py":1513
 * 
 *     def get(self, key, default = NONE, **kw):
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):             # <<<<<<<<<<<<<<
 *             if default is NONE:
 *                 ckey = key
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1519
 *                 ckey = (key, default)
 *         else:
 *             ckey = NONE             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.get, key, default, **kw),
 *             self.coalesce_get, ckey)
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_ckey = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1520
 *         else:
 *             ckey = NONE
 *         return self._enqueue(functools.partial(self.client.get, key, default, **kw),             # <<<<<<<<<<<<<<
 *             self.coalesce_get, ckey)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_functools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_partial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_default);
  __pyx_t_8 = 0;
  __pyx_t_8 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1521
 *             ckey = NONE
 *         return self._enqueue(functools.partial(self.client.get, key, default, **kw),
 *             self.coalesce_get, ckey)             # <<<<<<<<<<<<<<
 * 
 *     def contains(self, key, *p, **kw):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_9, __pyx_t_8, __pyx_v_ckey};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_9, __pyx_t_8, __pyx_v_ckey};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_8);
    __Pyx_INCREF(__pyx_v_ckey);
    __Pyx_GIVEREF(__pyx_v_ckey);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_v_ckey);
    __pyx_t_9 = 0;
    __pyx_t_8 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1512
 *             self.coalesce_getTtl, ckey)
 * 
 *     def get(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ckey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1523
 *             self.coalesce_get, ckey)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_23contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_23contains = {"contains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_23contains, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_23contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contains (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_p = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_p)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_p);
  } else {
    __pyx_v_p = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("contains", 0, 2, 2, 1); __PYX_ERR(0, 1523, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "contains") < 0)) __PYX_ERR(0, 1523, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contains", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1523, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_p); __pyx_v_p = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_22contains(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_p, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_22contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_p, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_ckey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contains", 0);

  /* "chorde/clients/async.py":1524
 * 
 *     def contains(self, key, *p, **kw):
 *         if not p and not kw:             # <<<<<<<<<<<<<<
 *             ckey = key
 *         elif not kw:
 */
  __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_p) != 0);
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":1525
 *     def contains(self, key, *p, **kw):
 *         if not p and not kw:
 *             ckey = key             # <<<<<<<<<<<<<<
 *         elif not kw:
 *             ckey = (key, p)
 */
    __Pyx_INCREF(__pyx_v_key);
    __pyx_v_ckey = __pyx_v_key;

    /* "chorde/clients/async.py":1524
 * 
 *     def contains(self, key, *p, **kw):
 *         if not p and not kw:             # <<<<<<<<<<<<<<
 *             ckey = key
 *         elif not kw:
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1526
 *         if not p and not kw:
 *             ckey = key
 *         elif not kw:             # <<<<<<<<<<<<<<
 *             ckey = (key, p)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1526, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":1527
 *             ckey = key
 *         elif not kw:
 *             ckey = (key, p)             # <<<<<<<<<<<<<<
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_p);
    __Pyx_GIVEREF(__pyx_v_p);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_p);
    __pyx_v_ckey = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "chorde/clients/async.py":1526
 *         if not p and not kw:
 *             ckey = key
 *         elif not kw:             # <<<<<<<<<<<<<<
 *             ckey = (key, p)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1529
 *             ckey = (key, p)
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.contains, key, *p, **kw),
 *             self.coalesce_contains, ckey)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyDict_Items(__pyx_v_kw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyFrozenSet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_p);
    __Pyx_GIVEREF(__pyx_v_p);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_ckey = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1530
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self._enqueue(functools.partial(self.client.contains, key, *p, **kw),             # <<<<<<<<<<<<<<
 *             self.coalesce_contains, ckey)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_functools); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_partial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_key);
  __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_v_p); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":1531
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self._enqueue(functools.partial(self.client.contains, key, *p, **kw),
 *             self.coalesce_contains, ckey)             # <<<<<<<<<<<<<<
 * 
 *     def put(self, key, value, ttl, **kw):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_contains); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_9, __pyx_t_6, __pyx_v_ckey};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_9, __pyx_t_6, __pyx_v_ckey};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_ckey);
    __Pyx_GIVEREF(__pyx_v_ckey);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_v_ckey);
    __pyx_t_9 = 0;
    __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1523
 *             self.coalesce_get, ckey)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ckey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1533
 *             self.coalesce_contains, ckey)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_25put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_25put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_25put, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_25put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 1); __PYX_ERR(0, 1533, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 2); __PYX_ERR(0, 1533, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 3); __PYX_ERR(0, 1533, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "put") < 0)) __PYX_ERR(0, 1533, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1533, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_24put(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_24put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);

  /* "chorde/clients/async.py":1534
 * 
 *     def put(self, key, value, ttl, **kw):
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))             # <<<<<<<<<<<<<<
 * 
 *     def renew(self, key, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_partial); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_put); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ttl);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1533
 *             self.coalesce_contains, ckey)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1536
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_27renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_27renew = {"renew", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_27renew, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_27renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renew (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ttl,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 1); __PYX_ERR(0, 1536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 2); __PYX_ERR(0, 1536, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "renew") < 0)) __PYX_ERR(0, 1536, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_ttl = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1536, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_26renew(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_26renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renew", 0);

  /* "chorde/clients/async.py":1537
 * 
 *     def renew(self, key, ttl, **kw):
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))             # <<<<<<<<<<<<<<
 * 
 *     def add(self, key, value, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_partial); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_renew); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_ttl);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1536
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1539
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_29add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_29add = {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_29add, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_29add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 1539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 1539, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(0, 1539, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "add") < 0)) __PYX_ERR(0, 1539, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1539, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_28add(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_28add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "chorde/clients/async.py":1540
 * 
 *     def add(self, key, value, ttl, **kw):
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_partial); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ttl);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1539
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1542
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_31delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_31delete = {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_31delete, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_31delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, 1); __PYX_ERR(0, 1542, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(0, 1542, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1542, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_30delete(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_30delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "chorde/clients/async.py":1543
 * 
 *     def delete(self, key):
 *         return self._enqueue(functools.partial(self.client.delete, key))             # <<<<<<<<<<<<<<
 * 
 *     def expire(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_functools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_partial); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_delete); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_key};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_key};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_key);
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1542
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1545
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_33expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_33expire = {"expire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_33expire, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_33expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expire (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, 1); __PYX_ERR(0, 1545, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "expire") < 0)) __PYX_ERR(0, 1545, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1545, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_32expire(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_32expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expire", 0);

  /* "chorde/clients/async.py":1546
 * 
 *     def expire(self, key):
 *         return self._enqueue(functools.partial(self.client.expire, key))             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_functools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_partial); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_expire); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_key};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_key};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_key);
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1545
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1548
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.clear)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_35clear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_35clear = {"clear", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_35clear, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_35clear(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_34clear(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_34clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 0);

  /* "chorde/clients/async.py":1549
 * 
 *     def clear(self):
 *         return self._enqueue(self.client.clear)             # <<<<<<<<<<<<<<
 * 
 *     def purge(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1548
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.clear)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1551
 *         return self._enqueue(self.client.clear)
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.purge)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_37purge(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_37purge = {"purge", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_37purge, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_37purge(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("purge (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_36purge(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_36purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("purge", 0);

  /* "chorde/clients/async.py":1552
 * 
 *     def purge(self):
 *         return self._enqueue(self.client.purge)             # <<<<<<<<<<<<<<
 * 
 *     def register_cleanup(self, task):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_purge); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1551
 *         return self._enqueue(self.client.clear)
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.purge)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1554
 *         return self._enqueue(self.client.purge)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_39register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_38register_cleanup[] = "\n        Register a callable that will take no arguments, and will\n        be invoked every cleanup_cycles tasks in order to perform\n        thread-local cleanup for this processor.\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_39register_cleanup = {"register_cleanup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_39register_cleanup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_38register_cleanup};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_39register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_task = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_cleanup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_task,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_task)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, 1); __PYX_ERR(0, 1554, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_cleanup") < 0)) __PYX_ERR(0, 1554, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_task = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1554, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_38register_cleanup(__pyx_self, __pyx_v_self, __pyx_v_task);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_38register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_cleanup", 0);

  /* "chorde/clients/async.py":1560
 *         thread-local cleanup for this processor.
 *         """
 *         self.cleanup_tasks.append(task)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cleanup_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_task); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1554
 *         return self._enqueue(self.client.purge)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1563
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_41register_default_cleanup(PyObject *__pyx_self, PyObject *__pyx_v_task); /*proto*/
static char __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_40register_default_cleanup[] = "\n        Register a callable that will take no arguments, and will\n        be invoked every cleanup_cycles tasks in order to perform\n        thread-local cleanup for all async processors (including\n        async writers).\n        ";
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_41register_default_cleanup = {"register_default_cleanup", (PyCFunction)__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_41register_default_cleanup, METH_O, __pyx_doc_6chorde_7clients_5async_19AsyncCacheProcessor_40register_default_cleanup};
static PyObject *__pyx_pw_6chorde_7clients_5async_19AsyncCacheProcessor_41register_default_cleanup(PyObject *__pyx_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_default_cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_40register_default_cleanup(__pyx_self, ((PyObject *)__pyx_v_task));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_19AsyncCacheProcessor_40register_default_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_default_cleanup", 0);

  /* "chorde/clients/async.py":1570
 *         async writers).
 *         """
 *         _global_cleanup_tasks.append(task)             # <<<<<<<<<<<<<<
 * 
 * class WrappedCacheProcessor(object):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_global_cleanup_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_task); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1563
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("chorde.clients.async.AsyncCacheProcessor.register_default_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1577
 *     different client.
 *     """
 *     def __init__(self, processor, client, coalescence_buffer_size = 500):             # <<<<<<<<<<<<<<
 *         self.processor = processor
 *         self.client = client
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_processor = 0;
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_coalescence_buffer_size = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_processor,&__pyx_n_s_client,&__pyx_n_s_coalescence_buffer_size,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)__pyx_int_500));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_processor)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 1577, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 1577, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coalescence_buffer_size);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1577, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_processor = values[1];
    __pyx_v_client = values[2];
    __pyx_v_coalescence_buffer_size = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1577, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor___init__(__pyx_self, __pyx_v_self, __pyx_v_processor, __pyx_v_client, __pyx_v_coalescence_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_processor, PyObject *__pyx_v_client, PyObject *__pyx_v_coalescence_buffer_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "chorde/clients/async.py":1578
 *     """
 *     def __init__(self, processor, client, coalescence_buffer_size = 500):
 *         self.processor = processor             # <<<<<<<<<<<<<<
 *         self.client = client
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_processor, __pyx_v_processor) < 0) __PYX_ERR(0, 1578, __pyx_L1_error)

  /* "chorde/clients/async.py":1579
 *     def __init__(self, processor, client, coalescence_buffer_size = 500):
 *         self.processor = processor
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_client, __pyx_v_client) < 0) __PYX_ERR(0, 1579, __pyx_L1_error)

  /* "chorde/clients/async.py":1580
 *         self.processor = processor
 *         self.client = client
 *         self.coalesce_get = Cache(coalescence_buffer_size)             # <<<<<<<<<<<<<<
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)
 *         self.coalesce_contains = Cache(coalescence_buffer_size)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_coalescence_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_coalescence_buffer_size);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_get, __pyx_t_1) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1581
 *         self.client = client
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)             # <<<<<<<<<<<<<<
 *         self.coalesce_contains = Cache(coalescence_buffer_size)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_coalescence_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_coalescence_buffer_size);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_getTtl, __pyx_t_1) < 0) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1582
 *         self.coalesce_get = Cache(coalescence_buffer_size)
 *         self.coalesce_getTtl = Cache(coalescence_buffer_size)
 *         self.coalesce_contains = Cache(coalescence_buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_coalescence_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_coalescence_buffer_size);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_contains, __pyx_t_1) < 0) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1577
 *     different client.
 *     """
 *     def __init__(self, processor, client, coalescence_buffer_size = 500):             # <<<<<<<<<<<<<<
 *         self.processor = processor
 *         self.client = client
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1585
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_3capacity(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_3capacity = {"capacity", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_3capacity, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_3capacity(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_2capacity(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_2capacity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("capacity", 0);

  /* "chorde/clients/async.py":1586
 *     @property
 *     def capacity(self):
 *         return self.client.capacity             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1585
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1589
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_5usage(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_5usage = {"usage", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_5usage, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_5usage(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("usage (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_4usage(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_4usage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("usage", 0);

  /* "chorde/clients/async.py":1590
 *     @property
 *     def usage(self):
 *         return self.client.usage             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_usage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1589
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.usage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1593
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self.processor.queuelen
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_7queuelen(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_7queuelen = {"queuelen", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_7queuelen, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_7queuelen(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("queuelen (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_6queuelen(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_6queuelen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("queuelen", 0);

  /* "chorde/clients/async.py":1594
 *     @property
 *     def queuelen(self):
 *         return self.processor.queuelen             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_queuelen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1593
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self.processor.queuelen
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.queuelen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1597
 * 
 *     @property
 *     def maxqueue(self):             # <<<<<<<<<<<<<<
 *         return self.processor.maxqueue
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_9maxqueue(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_9maxqueue = {"maxqueue", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_9maxqueue, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_9maxqueue(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("maxqueue (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_8maxqueue(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_8maxqueue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("maxqueue", 0);

  /* "chorde/clients/async.py":1598
 *     @property
 *     def maxqueue(self):
 *         return self.processor.maxqueue             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxqueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1597
 * 
 *     @property
 *     def maxqueue(self):             # <<<<<<<<<<<<<<
 *         return self.processor.maxqueue
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.maxqueue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1601
 * 
 *     @property
 *     def stats(self):             # <<<<<<<<<<<<<<
 *         return self.processor.stats
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_11stats(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_11stats = {"stats", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_11stats, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_11stats(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stats (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_10stats(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_10stats(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stats", 0);

  /* "chorde/clients/async.py":1602
 *     @property
 *     def stats(self):
 *         return self.processor.stats             # <<<<<<<<<<<<<<
 * 
 *     def do_async(self, func, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1601
 * 
 *     @property
 *     def stats(self):             # <<<<<<<<<<<<<<
 *         return self.processor.stats
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1604
 *         return self.processor.stats
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_13do_async(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_13do_async = {"do_async", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_13do_async, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_13do_async(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_async (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_async", 0, 2, 2, 1); __PYX_ERR(0, 1604, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "do_async") < 0)) __PYX_ERR(0, 1604, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_async", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1604, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.do_async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_12do_async(__pyx_self, __pyx_v_self, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_12do_async(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_async", 0);

  /* "chorde/clients/async.py":1605
 * 
 *     def do_async(self, func, *args, **kwargs):
 *         return self.processor.do_async(func, *args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def bound(self, client):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_do_async); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1604
 *         return self.processor.stats
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.do_async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1607
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         if client is self.client:
 *             return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_15bound(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_15bound = {"bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_15bound, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_15bound(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_client = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bound (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_client,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("bound", 1, 2, 2, 1); __PYX_ERR(0, 1607, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bound") < 0)) __PYX_ERR(0, 1607, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_client = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1607, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_14bound(__pyx_self, __pyx_v_self, __pyx_v_client);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_14bound(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bound", 0);

  /* "chorde/clients/async.py":1608
 * 
 *     def bound(self, client):
 *         if client is self.client:             # <<<<<<<<<<<<<<
 *             return self
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_client == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1609
 *     def bound(self, client):
 *         if client is self.client:
 *             return self             # <<<<<<<<<<<<<<
 *         else:
 *             return WrappedCacheProcessor(self.processor, client)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "chorde/clients/async.py":1608
 * 
 *     def bound(self, client):
 *         if client is self.client:             # <<<<<<<<<<<<<<
 *             return self
 *         else:
 */
  }

  /* "chorde/clients/async.py":1611
 *             return self
 *         else:
 *             return WrappedCacheProcessor(self.processor, client)             # <<<<<<<<<<<<<<
 * 
 *     def getTtl(self, key, default = NONE, **kw):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_WrappedCacheProcessor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_client};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1611, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_client};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1611, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
      __Pyx_INCREF(__pyx_v_client);
      __Pyx_GIVEREF(__pyx_v_client);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_client);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "chorde/clients/async.py":1607
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         if client is self.client:
 *             return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1613
 *             return WrappedCacheProcessor(self.processor, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw:
 *             if default is NONE:
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_default);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_17getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_17getTtl = {"getTtl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_17getTtl, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_17getTtl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTtl (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults20 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 3, 1); __PYX_ERR(0, 1613, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "getTtl") < 0)) __PYX_ERR(0, 1613, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getTtl", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1613, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_16getTtl(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_16getTtl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_ckey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTtl", 0);

  /* "chorde/clients/async.py":1614
 * 
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw:             # <<<<<<<<<<<<<<
 *             if default is NONE:
 *                 ckey = key
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1614, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":1615
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw:
 *             if default is NONE:             # <<<<<<<<<<<<<<
 *                 ckey = key
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (__pyx_v_default == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "chorde/clients/async.py":1616
 *         if not kw:
 *             if default is NONE:
 *                 ckey = key             # <<<<<<<<<<<<<<
 *             else:
 *                 ckey = (key, default)
 */
      __Pyx_INCREF(__pyx_v_key);
      __pyx_v_ckey = __pyx_v_key;

      /* "chorde/clients/async.py":1615
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw:
 *             if default is NONE:             # <<<<<<<<<<<<<<
 *                 ckey = key
 *             else:
 */
      goto __pyx_L4;
    }

    /* "chorde/clients/async.py":1618
 *                 ckey = key
 *             else:
 *                 ckey = (key, default)             # <<<<<<<<<<<<<<
 *         else:
 *             ckey = NONE
 */
    /*else*/ {
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
      __Pyx_INCREF(__pyx_v_default);
      __Pyx_GIVEREF(__pyx_v_default);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_default);
      __pyx_v_ckey = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "chorde/clients/async.py":1614
 * 
 *     def getTtl(self, key, default = NONE, **kw):
 *         if not kw:             # <<<<<<<<<<<<<<
 *             if default is NONE:
 *                 ckey = key
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1620
 *                 ckey = (key, default)
 *         else:
 *             ckey = NONE             # <<<<<<<<<<<<<<
 *         return self.processor.do_async_coalescent(self.coalesce_getTtl, ckey,
 *             self.client.getTtl, key, default, **kw)
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ckey = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1621
 *         else:
 *             ckey = NONE
 *         return self.processor.do_async_coalescent(self.coalesce_getTtl, ckey,             # <<<<<<<<<<<<<<
 *             self.client.getTtl, key, default, **kw)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_do_async_coalescent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_getTtl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "chorde/clients/async.py":1622
 *             ckey = NONE
 *         return self.processor.do_async_coalescent(self.coalesce_getTtl, ckey,
 *             self.client.getTtl, key, default, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def get(self, key, default = NONE):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getTtl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":1621
 *         else:
 *             ckey = NONE
 *         return self.processor.do_async_coalescent(self.coalesce_getTtl, ckey,             # <<<<<<<<<<<<<<
 *             self.client.getTtl, key, default, **kw)
 * 
 */
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_ckey);
  __Pyx_GIVEREF(__pyx_v_ckey);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ckey);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_default);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;

  /* "chorde/clients/async.py":1622
 *             ckey = NONE
 *         return self.processor.do_async_coalescent(self.coalesce_getTtl, ckey,
 *             self.client.getTtl, key, default, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def get(self, key, default = NONE):
 */
  __pyx_t_6 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":1621
 *         else:
 *             ckey = NONE
 *         return self.processor.do_async_coalescent(self.coalesce_getTtl, ckey,             # <<<<<<<<<<<<<<
 *             self.client.getTtl, key, default, **kw)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1613
 *             return WrappedCacheProcessor(self.processor, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw:
 *             if default is NONE:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.getTtl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ckey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1624
 *             self.client.getTtl, key, default, **kw)
 * 
 *     def get(self, key, default = NONE):             # <<<<<<<<<<<<<<
 *         if default is NONE:
 *             ckey = key
 */

static PyObject *__pyx_pf_6chorde_7clients_5async_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_default);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_default);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_default);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("chorde.clients.async.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_19get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_19get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_19get, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_19get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults21 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_default;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, 1); __PYX_ERR(0, 1624, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1624, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1624, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_18get(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_18get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
  PyObject *__pyx_v_ckey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "chorde/clients/async.py":1625
 * 
 *     def get(self, key, default = NONE):
 *         if default is NONE:             # <<<<<<<<<<<<<<
 *             ckey = key
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_default == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "chorde/clients/async.py":1626
 *     def get(self, key, default = NONE):
 *         if default is NONE:
 *             ckey = key             # <<<<<<<<<<<<<<
 *         else:
 *             ckey = (key, default)
 */
    __Pyx_INCREF(__pyx_v_key);
    __pyx_v_ckey = __pyx_v_key;

    /* "chorde/clients/async.py":1625
 * 
 *     def get(self, key, default = NONE):
 *         if default is NONE:             # <<<<<<<<<<<<<<
 *             ckey = key
 *         else:
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1628
 *             ckey = key
 *         else:
 *             ckey = (key, default)             # <<<<<<<<<<<<<<
 *         return self.processor.do_async_coalescent(self.coalesce_get, ckey,
 *             self.client.get, key, default)
 */
  /*else*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_default);
    __Pyx_GIVEREF(__pyx_v_default);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_default);
    __pyx_v_ckey = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1629
 *         else:
 *             ckey = (key, default)
 *         return self.processor.do_async_coalescent(self.coalesce_get, ckey,             # <<<<<<<<<<<<<<
 *             self.client.get, key, default)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_do_async_coalescent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1630
 *             ckey = (key, default)
 *         return self.processor.do_async_coalescent(self.coalesce_get, ckey,
 *             self.client.get, key, default)             # <<<<<<<<<<<<<<
 * 
 *     def contains(self, key, *p, **kw):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[6] = {__pyx_t_6, __pyx_t_4, __pyx_v_ckey, __pyx_t_7, __pyx_v_key, __pyx_v_default};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 5+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[6] = {__pyx_t_6, __pyx_t_4, __pyx_v_ckey, __pyx_t_7, __pyx_v_key, __pyx_v_default};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 5+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_ckey);
    __Pyx_GIVEREF(__pyx_v_ckey);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_ckey);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_default);
    __Pyx_GIVEREF(__pyx_v_default);
    PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_8, __pyx_v_default);
    __pyx_t_4 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1624
 *             self.client.getTtl, key, default, **kw)
 * 
 *     def get(self, key, default = NONE):             # <<<<<<<<<<<<<<
 *         if default is NONE:
 *             ckey = key
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ckey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1632
 *             self.client.get, key, default)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_21contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_21contains = {"contains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_21contains, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_21contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("contains (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_p = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_p)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_p);
  } else {
    __pyx_v_p = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("contains", 0, 2, 2, 1); __PYX_ERR(0, 1632, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "contains") < 0)) __PYX_ERR(0, 1632, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("contains", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1632, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_p); __pyx_v_p = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_20contains(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_p, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_20contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_p, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_ckey = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("contains", 0);

  /* "chorde/clients/async.py":1633
 * 
 *     def contains(self, key, *p, **kw):
 *         if not p and not kw:             # <<<<<<<<<<<<<<
 *             ckey = key
 *         elif not kw:
 */
  __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_p) != 0);
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "chorde/clients/async.py":1634
 *     def contains(self, key, *p, **kw):
 *         if not p and not kw:
 *             ckey = key             # <<<<<<<<<<<<<<
 *         elif not kw:
 *             ckey = (key, p)
 */
    __Pyx_INCREF(__pyx_v_key);
    __pyx_v_ckey = __pyx_v_key;

    /* "chorde/clients/async.py":1633
 * 
 *     def contains(self, key, *p, **kw):
 *         if not p and not kw:             # <<<<<<<<<<<<<<
 *             ckey = key
 *         elif not kw:
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1635
 *         if not p and not kw:
 *             ckey = key
 *         elif not kw:             # <<<<<<<<<<<<<<
 *             ckey = (key, p)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "chorde/clients/async.py":1636
 *             ckey = key
 *         elif not kw:
 *             ckey = (key, p)             # <<<<<<<<<<<<<<
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_p);
    __Pyx_GIVEREF(__pyx_v_p);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_p);
    __pyx_v_ckey = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "chorde/clients/async.py":1635
 *         if not p and not kw:
 *             ckey = key
 *         elif not kw:             # <<<<<<<<<<<<<<
 *             ckey = (key, p)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "chorde/clients/async.py":1638
 *             ckey = (key, p)
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))             # <<<<<<<<<<<<<<
 *         return self.processor.do_async_coalescent(self.coalesce_contains, ckey,
 *             self.client.contains, key, *p, **kw)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyDict_Items(__pyx_v_kw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyFrozenSet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_p);
    __Pyx_GIVEREF(__pyx_v_p);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_p);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_ckey = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "chorde/clients/async.py":1639
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self.processor.do_async_coalescent(self.coalesce_contains, ckey,             # <<<<<<<<<<<<<<
 *             self.client.contains, key, *p, **kw)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_do_async_coalescent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_coalesce_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1640
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self.processor.do_async_coalescent(self.coalesce_contains, ckey,
 *             self.client.contains, key, *p, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def put(self, key, value, ttl, **kw):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_contains_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":1639
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self.processor.do_async_coalescent(self.coalesce_contains, ckey,             # <<<<<<<<<<<<<<
 *             self.client.contains, key, *p, **kw)
 * 
 */
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_ckey);
  __Pyx_GIVEREF(__pyx_v_ckey);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ckey);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_key);
  __pyx_t_4 = 0;
  __pyx_t_7 = 0;

  /* "chorde/clients/async.py":1640
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self.processor.do_async_coalescent(self.coalesce_contains, ckey,
 *             self.client.contains, key, *p, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def put(self, key, value, ttl, **kw):
 */
  __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":1639
 *         else:
 *             ckey = (key, p, frozenset(kw.items()))
 *         return self.processor.do_async_coalescent(self.coalesce_contains, ckey,             # <<<<<<<<<<<<<<
 *             self.client.contains, key, *p, **kw)
 * 
 */
  __pyx_t_6 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1632
 *             self.client.get, key, default)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ckey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1642
 *             self.client.contains, key, *p, **kw)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_23put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_23put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_23put, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_23put(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 1); __PYX_ERR(0, 1642, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 2); __PYX_ERR(0, 1642, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, 3); __PYX_ERR(0, 1642, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "put") < 0)) __PYX_ERR(0, 1642, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1642, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_22put(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_22put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 0);

  /* "chorde/clients/async.py":1643
 * 
 *     def put(self, key, value, ttl, **kw):
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def renew(self, key, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_do_async); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ttl);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1642
 *             self.client.contains, key, *p, **kw)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1645
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_25renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_25renew = {"renew", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_25renew, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_25renew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renew (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_ttl,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 1); __PYX_ERR(0, 1645, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, 2); __PYX_ERR(0, 1645, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "renew") < 0)) __PYX_ERR(0, 1645, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_ttl = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1645, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_24renew(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_24renew(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renew", 0);

  /* "chorde/clients/async.py":1646
 * 
 *     def renew(self, key, ttl, **kw):
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def add(self, key, value, ttl, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_do_async); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_renew); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_ttl);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1645
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.renew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1648
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_27add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_27add = {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_27add, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_27add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_ttl = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_ttl,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 1); __PYX_ERR(0, 1648, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 2); __PYX_ERR(0, 1648, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ttl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, 3); __PYX_ERR(0, 1648, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "add") < 0)) __PYX_ERR(0, 1648, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_ttl = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1648, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_26add(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_ttl, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_26add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_ttl, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);

  /* "chorde/clients/async.py":1649
 * 
 *     def add(self, key, value, ttl, **kw):
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def delete(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_do_async); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_ttl);
  __Pyx_GIVEREF(__pyx_v_ttl);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ttl);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1648
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1651
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.delete, key)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_29delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_29delete = {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_29delete, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_29delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, 1); __PYX_ERR(0, 1651, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(0, 1651, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1651, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_28delete(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_28delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "chorde/clients/async.py":1652
 * 
 *     def delete(self, key):
 *         return self.processor.do_async(self.client.delete, key)             # <<<<<<<<<<<<<<
 * 
 *     def expire(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_do_async); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_delete); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_key};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_key};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_key);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1651
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.delete, key)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1654
 *         return self.processor.do_async(self.client.delete, key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.expire, key)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_31expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_31expire = {"expire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_31expire, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_31expire(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expire (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, 1); __PYX_ERR(0, 1654, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "expire") < 0)) __PYX_ERR(0, 1654, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("expire", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1654, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_30expire(__pyx_self, __pyx_v_self, __pyx_v_key);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_30expire(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expire", 0);

  /* "chorde/clients/async.py":1655
 * 
 *     def expire(self, key):
 *         return self.processor.do_async(self.client.expire, key)             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_do_async); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_expire); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_key};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_key};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_key);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1654
 *         return self.processor.do_async(self.client.delete, key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.expire, key)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.expire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1657
 *         return self.processor.do_async(self.client.expire, key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.clear)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_33clear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_33clear = {"clear", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_33clear, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_33clear(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_32clear(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_32clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 0);

  /* "chorde/clients/async.py":1658
 * 
 *     def clear(self):
 *         return self.processor.do_async(self.client.clear)             # <<<<<<<<<<<<<<
 * 
 *     def purge(self, *p, **kw):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_do_async); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1657
 *         return self.processor.do_async(self.client.expire, key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.clear)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1660
 *         return self.processor.do_async(self.client.clear)
 * 
 *     def purge(self, *p, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_35purge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_35purge = {"purge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_35purge, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_35purge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_kw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("purge (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_p = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_p)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_p);
  } else {
    __pyx_v_p = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "purge") < 0)) __PYX_ERR(0, 1660, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("purge", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1660, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_p); __pyx_v_p = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_34purge(__pyx_self, __pyx_v_self, __pyx_v_p, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_34purge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("purge", 0);

  /* "chorde/clients/async.py":1661
 * 
 *     def purge(self, *p, **kw):
 *         return self.processor.do_async(self.client.purge, *p, **kw)             # <<<<<<<<<<<<<<
 * 
 *     def register_cleanup(self, task):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_do_async); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_purge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_Copy(__pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "chorde/clients/async.py":1660
 *         return self.processor.do_async(self.client.clear)
 * 
 *     def purge(self, *p, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1663
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         self.processor.register_cleanup(task)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_37register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_37register_cleanup = {"register_cleanup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_37register_cleanup, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_37register_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_task = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_cleanup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_task,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_task)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, 1); __PYX_ERR(0, 1663, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_cleanup") < 0)) __PYX_ERR(0, 1663, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_task = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_cleanup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1663, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_36register_cleanup(__pyx_self, __pyx_v_self, __pyx_v_task);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_36register_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_cleanup", 0);

  /* "chorde/clients/async.py":1664
 * 
 *     def register_cleanup(self, task):
 *         self.processor.register_cleanup(task)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_cleanup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_task) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_task);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1663
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         self.processor.register_cleanup(task)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.register_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "chorde/clients/async.py":1667
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         AsyncCacheProcessor.register_default_cleanup(task)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_39register_default_cleanup(PyObject *__pyx_self, PyObject *__pyx_v_task); /*proto*/
static PyMethodDef __pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_39register_default_cleanup = {"register_default_cleanup", (PyCFunction)__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_39register_default_cleanup, METH_O, 0};
static PyObject *__pyx_pw_6chorde_7clients_5async_21WrappedCacheProcessor_39register_default_cleanup(PyObject *__pyx_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_default_cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_38register_default_cleanup(__pyx_self, ((PyObject *)__pyx_v_task));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6chorde_7clients_5async_21WrappedCacheProcessor_38register_default_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_task) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_default_cleanup", 0);

  /* "chorde/clients/async.py":1668
 *     @staticmethod
 *     def register_default_cleanup(task):
 *         AsyncCacheProcessor.register_default_cleanup(task)             # <<<<<<<<<<<<<<
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AsyncCacheProcessor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_default_cleanup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_task) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_task);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":1667
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         AsyncCacheProcessor.register_default_cleanup(task)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("chorde.clients.async.WrappedCacheProcessor.register_default_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_NONE);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_v__CLEAR);
  Py_CLEAR(p->__pyx_v__DELETE);
  Py_CLEAR(p->__pyx_v__EXPIRE);
  Py_CLEAR(p->__pyx_v__NONE);
  Py_CLEAR(p->__pyx_v__RENEW);
  Py_CLEAR(p->__pyx_v_default);
  Py_CLEAR(p->__pyx_v_default_rv);
  Py_CLEAR(p->__pyx_v_ettl);
  Py_CLEAR(p->__pyx_v_ettlget);
  Py_CLEAR(p->__pyx_v_hasattr);
  Py_CLEAR(p->__pyx_v_key);
  Py_CLEAR(p->__pyx_v_keys);
  Py_CLEAR(p->__pyx_v_kw);
  Py_CLEAR(p->__pyx_v_nkeys);
  Py_CLEAR(p->__pyx_v_nkeys_append);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_ttl);
  Py_CLEAR(p->__pyx_v_value);
  Py_CLEAR(p->__pyx_v_wgetTtl);
  Py_CLEAR(p->__pyx_v_writer);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti *)o;
  if (p->__pyx_v_NONE) {
    e = (*v)(p->__pyx_v_NONE, a); if (e) return e;
  }
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_v__CLEAR) {
    e = (*v)(p->__pyx_v__CLEAR, a); if (e) return e;
  }
  if (p->__pyx_v__DELETE) {
    e = (*v)(p->__pyx_v__DELETE, a); if (e) return e;
  }
  if (p->__pyx_v__EXPIRE) {
    e = (*v)(p->__pyx_v__EXPIRE, a); if (e) return e;
  }
  if (p->__pyx_v__NONE) {
    e = (*v)(p->__pyx_v__NONE, a); if (e) return e;
  }
  if (p->__pyx_v__RENEW) {
    e = (*v)(p->__pyx_v__RENEW, a); if (e) return e;
  }
  if (p->__pyx_v_default) {
    e = (*v)(p->__pyx_v_default, a); if (e) return e;
  }
  if (p->__pyx_v_default_rv) {
    e = (*v)(p->__pyx_v_default_rv, a); if (e) return e;
  }
  if (p->__pyx_v_ettl) {
    e = (*v)(p->__pyx_v_ettl, a); if (e) return e;
  }
  if (p->__pyx_v_ettlget) {
    e = (*v)(p->__pyx_v_ettlget, a); if (e) return e;
  }
  if (p->__pyx_v_hasattr) {
    e = (*v)(p->__pyx_v_hasattr, a); if (e) return e;
  }
  if (p->__pyx_v_key) {
    e = (*v)(p->__pyx_v_key, a); if (e) return e;
  }
  if (p->__pyx_v_keys) {
    e = (*v)(p->__pyx_v_keys, a); if (e) return e;
  }
  if (p->__pyx_v_kw) {
    e = (*v)(p->__pyx_v_kw, a); if (e) return e;
  }
  if (p->__pyx_v_nkeys) {
    e = (*v)(p->__pyx_v_nkeys, a); if (e) return e;
  }
  if (p->__pyx_v_nkeys_append) {
    e = (*v)(p->__pyx_v_nkeys_append, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_ttl) {
    e = (*v)(p->__pyx_v_ttl, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  if (p->__pyx_v_wgetTtl) {
    e = (*v)(p->__pyx_v_wgetTtl, a); if (e) return e;
  }
  if (p->__pyx_v_writer) {
    e = (*v)(p->__pyx_v_writer, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct__getTtlMulti", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_1_getMulti[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_1_getMulti = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_1_getMulti(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_1_getMulti > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_1_getMulti[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_1_getMulti];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_1_getMulti(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_NONE);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_v__CLEAR);
  Py_CLEAR(p->__pyx_v__DELETE);
  Py_CLEAR(p->__pyx_v__EXPIRE);
  Py_CLEAR(p->__pyx_v__NONE);
  Py_CLEAR(p->__pyx_v__RENEW);
  Py_CLEAR(p->__pyx_v_default);
  Py_CLEAR(p->__pyx_v_ettl);
  Py_CLEAR(p->__pyx_v_ettl_append);
  Py_CLEAR(p->__pyx_v_hasattr);
  Py_CLEAR(p->__pyx_v_key);
  Py_CLEAR(p->__pyx_v_keys);
  Py_CLEAR(p->__pyx_v_kw);
  Py_CLEAR(p->__pyx_v_nkeys);
  Py_CLEAR(p->__pyx_v_nkeys_append);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_ttl);
  Py_CLEAR(p->__pyx_v_ttl_skip);
  Py_CLEAR(p->__pyx_v_value);
  Py_CLEAR(p->__pyx_v_wgetTtl);
  Py_CLEAR(p->__pyx_v_writer);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_1_getMulti < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_1_getMulti[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_1_getMulti++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_1_getMulti(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti *)o;
  if (p->__pyx_v_NONE) {
    e = (*v)(p->__pyx_v_NONE, a); if (e) return e;
  }
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_v__CLEAR) {
    e = (*v)(p->__pyx_v__CLEAR, a); if (e) return e;
  }
  if (p->__pyx_v__DELETE) {
    e = (*v)(p->__pyx_v__DELETE, a); if (e) return e;
  }
  if (p->__pyx_v__EXPIRE) {
    e = (*v)(p->__pyx_v__EXPIRE, a); if (e) return e;
  }
  if (p->__pyx_v__NONE) {
    e = (*v)(p->__pyx_v__NONE, a); if (e) return e;
  }
  if (p->__pyx_v__RENEW) {
    e = (*v)(p->__pyx_v__RENEW, a); if (e) return e;
  }
  if (p->__pyx_v_default) {
    e = (*v)(p->__pyx_v_default, a); if (e) return e;
  }
  if (p->__pyx_v_ettl) {
    e = (*v)(p->__pyx_v_ettl, a); if (e) return e;
  }
  if (p->__pyx_v_ettl_append) {
    e = (*v)(p->__pyx_v_ettl_append, a); if (e) return e;
  }
  if (p->__pyx_v_hasattr) {
    e = (*v)(p->__pyx_v_hasattr, a); if (e) return e;
  }
  if (p->__pyx_v_key) {
    e = (*v)(p->__pyx_v_key, a); if (e) return e;
  }
  if (p->__pyx_v_keys) {
    e = (*v)(p->__pyx_v_keys, a); if (e) return e;
  }
  if (p->__pyx_v_kw) {
    e = (*v)(p->__pyx_v_kw, a); if (e) return e;
  }
  if (p->__pyx_v_nkeys) {
    e = (*v)(p->__pyx_v_nkeys, a); if (e) return e;
  }
  if (p->__pyx_v_nkeys_append) {
    e = (*v)(p->__pyx_v_nkeys_append, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_ttl) {
    e = (*v)(p->__pyx_v_ttl, a); if (e) return e;
  }
  if (p->__pyx_v_ttl_skip) {
    e = (*v)(p->__pyx_v_ttl_skip, a); if (e) return e;
  }
  if (p->__pyx_v_value) {
    e = (*v)(p->__pyx_v_value, a); if (e) return e;
  }
  if (p->__pyx_v_wgetTtl) {
    e = (*v)(p->__pyx_v_wgetTtl, a); if (e) return e;
  }
  if (p->__pyx_v_writer) {
    e = (*v)(p->__pyx_v_writer, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_1_getMulti", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_1_getMulti), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_1_getMulti, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_1_getMulti, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_1_getMulti, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_2_on_value[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_2_on_value = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_2_on_value(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_2_on_value > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_2_on_value[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_2_on_value];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_2_on_value(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_callback);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_2_on_value < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_2_on_value[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_2_on_value++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_2_on_value(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *)o;
  if (p->__pyx_v_callback) {
    e = (*v)(p->__pyx_v_callback, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_2_on_value(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value *)o;
  tmp = ((PyObject*)p->__pyx_v_callback);
  p->__pyx_v_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_2_on_value", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_2_on_value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_2_on_value, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_2_on_value, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_2_on_value, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_2_on_value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_3_on_miss[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_3_on_miss = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_3_on_miss(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_3_on_miss > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_3_on_miss[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_3_on_miss];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_3_on_miss(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_callback);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_3_on_miss < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_3_on_miss[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_3_on_miss++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_3_on_miss(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *)o;
  if (p->__pyx_v_callback) {
    e = (*v)(p->__pyx_v_callback, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_3_on_miss(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss *)o;
  tmp = ((PyObject*)p->__pyx_v_callback);
  p->__pyx_v_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_3_on_miss", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_3_on_miss), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_3_on_miss, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_3_on_miss, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_3_on_miss, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_3_on_miss, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_4_on_exc[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_4_on_exc = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_4_on_exc(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_4_on_exc > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_4_on_exc[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_4_on_exc];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_4_on_exc(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_callback);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_4_on_exc < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_4_on_exc[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_4_on_exc++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_4_on_exc(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *)o;
  if (p->__pyx_v_callback) {
    e = (*v)(p->__pyx_v_callback, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_4_on_exc(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc *)o;
  tmp = ((PyObject*)p->__pyx_v_callback);
  p->__pyx_v_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_4_on_exc", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_4_on_exc), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_4_on_exc, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_4_on_exc, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_4_on_exc, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_4_on_exc, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_5_on_any[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_5_on_any = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_5_on_any(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_5_on_any > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_5_on_any[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_5_on_any];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_5_on_any(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_on_exc);
  Py_CLEAR(p->__pyx_v_on_miss);
  Py_CLEAR(p->__pyx_v_on_value);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_5_on_any < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_5_on_any[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_5_on_any++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_5_on_any(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *)o;
  if (p->__pyx_v_on_exc) {
    e = (*v)(p->__pyx_v_on_exc, a); if (e) return e;
  }
  if (p->__pyx_v_on_miss) {
    e = (*v)(p->__pyx_v_on_miss, a); if (e) return e;
  }
  if (p->__pyx_v_on_value) {
    e = (*v)(p->__pyx_v_on_value, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_5_on_any(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any *)o;
  tmp = ((PyObject*)p->__pyx_v_on_exc);
  p->__pyx_v_on_exc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_on_miss);
  p->__pyx_v_on_miss = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_on_value);
  p->__pyx_v_on_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_5_on_any", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_5_on_any), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_5_on_any, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_5_on_any, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_5_on_any, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_5_on_any, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_6_on_done[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_6_on_done = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_6_on_done(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_6_on_done > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_6_on_done[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_6_on_done];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_6_on_done(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_callback);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_6_on_done < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_6_on_done[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_6_on_done++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_6_on_done(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *)o;
  if (p->__pyx_v_callback) {
    e = (*v)(p->__pyx_v_callback, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_6_on_done(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done *)o;
  tmp = ((PyObject*)p->__pyx_v_callback);
  p->__pyx_v_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_6_on_done", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_6_on_done), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_6_on_done, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_6_on_done, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_6_on_done, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_6_on_done, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_7_chain_std[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_7_chain_std = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_7_chain_std(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_7_chain_std > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_7_chain_std[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_7_chain_std];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_7_chain_std(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_defer);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_7_chain_std < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_7_chain_std[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_7_chain_std++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_7_chain_std(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *)o;
  if (p->__pyx_v_defer) {
    e = (*v)(p->__pyx_v_defer, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_7_chain_std(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std *)o;
  tmp = ((PyObject*)p->__pyx_v_defer);
  p->__pyx_v_defer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_7_chain_std", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_7_chain_std), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_7_chain_std, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_7_chain_std, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_7_chain_std, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_7_chain_std, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_callback);
  Py_CLEAR(p->__pyx_v_me);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *)o;
  if (p->__pyx_v_callback) {
    e = (*v)(p->__pyx_v_callback, a); if (e) return e;
  }
  if (p->__pyx_v_me) {
    e = (*v)(p->__pyx_v_me, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback *)o;
  tmp = ((PyObject*)p->__pyx_v_callback);
  p->__pyx_v_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_me);
  p->__pyx_v_me = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_8_add_done_callback", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_9_mkf[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_9_mkf = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_9_mkf(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_9_mkf > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_9_mkf[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_9_mkf];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_9_mkf(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_name);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_9_mkf < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_9_mkf[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_9_mkf++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_9_mkf(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *)o;
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_9_mkf(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf *)o;
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_9_mkf", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_9_mkf), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_9_mkf, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_9_mkf, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_9_mkf, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_9_mkf, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_10__enqueue[8];
static int __pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_10__enqueue = 0;

static PyObject *__pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_10__enqueue(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_10__enqueue > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue)))) {
    o = (PyObject*)__pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_10__enqueue[--__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_10__enqueue];
    memset(o, 0, sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_10__enqueue(PyObject *o) {
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_action);
  Py_CLEAR(p->__pyx_v_cfuture);
  Py_CLEAR(p->__pyx_v_coalesce);
  Py_CLEAR(p->__pyx_v_coalesce_key);
  Py_CLEAR(p->__pyx_v_do_coalescence);
  Py_CLEAR(p->__pyx_v_logger);
  Py_CLEAR(p->__pyx_v_maxqueue);
  Py_CLEAR(p->__pyx_v_queue_time);
  Py_CLEAR(p->__pyx_v_stats);
  Py_CLEAR(p->__pyx_v_wself);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_10__enqueue < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue)))) {
    __pyx_freelist_6chorde_7clients_5async___pyx_scope_struct_10__enqueue[__pyx_freecount_6chorde_7clients_5async___pyx_scope_struct_10__enqueue++] = ((struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_10__enqueue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *)o;
  if (p->__pyx_v_action) {
    e = (*v)(p->__pyx_v_action, a); if (e) return e;
  }
  if (p->__pyx_v_cfuture) {
    e = (*v)(p->__pyx_v_cfuture, a); if (e) return e;
  }
  if (p->__pyx_v_coalesce) {
    e = (*v)(p->__pyx_v_coalesce, a); if (e) return e;
  }
  if (p->__pyx_v_coalesce_key) {
    e = (*v)(p->__pyx_v_coalesce_key, a); if (e) return e;
  }
  if (p->__pyx_v_do_coalescence) {
    e = (*v)(p->__pyx_v_do_coalescence, a); if (e) return e;
  }
  if (p->__pyx_v_logger) {
    e = (*v)(p->__pyx_v_logger, a); if (e) return e;
  }
  if (p->__pyx_v_maxqueue) {
    e = (*v)(p->__pyx_v_maxqueue, a); if (e) return e;
  }
  if (p->__pyx_v_queue_time) {
    e = (*v)(p->__pyx_v_queue_time, a); if (e) return e;
  }
  if (p->__pyx_v_stats) {
    e = (*v)(p->__pyx_v_stats, a); if (e) return e;
  }
  if (p->__pyx_v_wself) {
    e = (*v)(p->__pyx_v_wself, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_10__enqueue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *p = (struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue *)o;
  tmp = ((PyObject*)p->__pyx_v_action);
  p->__pyx_v_action = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_cfuture);
  p->__pyx_v_cfuture = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_coalesce);
  p->__pyx_v_coalesce = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_coalesce_key);
  p->__pyx_v_coalesce_key = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_do_coalescence);
  p->__pyx_v_do_coalescence = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_logger);
  p->__pyx_v_logger = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_maxqueue);
  p->__pyx_v_maxqueue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_queue_time);
  p->__pyx_v_queue_time = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_stats);
  p->__pyx_v_stats = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_wself);
  p->__pyx_v_wself = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue = {
  PyVarObject_HEAD_INIT(0, 0)
  "chorde.clients.async.__pyx_scope_struct_10__enqueue", /*tp_name*/
  sizeof(struct __pyx_obj_6chorde_7clients_5async___pyx_scope_struct_10__enqueue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6chorde_7clients_5async___pyx_scope_struct_10__enqueue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6chorde_7clients_5async___pyx_scope_struct_10__enqueue, /*tp_traverse*/
  __pyx_tp_clear_6chorde_7clients_5async___pyx_scope_struct_10__enqueue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6chorde_7clients_5async___pyx_scope_struct_10__enqueue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_async(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_async},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "async",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_An_async_cache_processor_will_a, __pyx_k_An_async_cache_processor_will_a, sizeof(__pyx_k_An_async_cache_processor_will_a), 0, 0, 1, 0},
  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor, __pyx_k_AsyncCacheProcessor, sizeof(__pyx_k_AsyncCacheProcessor), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessorThread, __pyx_k_AsyncCacheProcessorThread, sizeof(__pyx_k_AsyncCacheProcessorThread), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessorThreadPool, __pyx_k_AsyncCacheProcessorThreadPool, sizeof(__pyx_k_AsyncCacheProcessorThreadPool), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessorThreadPool_2, __pyx_k_AsyncCacheProcessorThreadPool_2, sizeof(__pyx_k_AsyncCacheProcessorThreadPool_2), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessorThreadPool_As, __pyx_k_AsyncCacheProcessorThreadPool_As, sizeof(__pyx_k_AsyncCacheProcessorThreadPool_As), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor___init, __pyx_k_AsyncCacheProcessor___init, sizeof(__pyx_k_AsyncCacheProcessor___init), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor__enqueue, __pyx_k_AsyncCacheProcessor__enqueue, sizeof(__pyx_k_AsyncCacheProcessor__enqueue), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor__enqueue_loc, __pyx_k_AsyncCacheProcessor__enqueue_loc, sizeof(__pyx_k_AsyncCacheProcessor__enqueue_loc), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor__enqueue_loc_2, __pyx_k_AsyncCacheProcessor__enqueue_loc_2, sizeof(__pyx_k_AsyncCacheProcessor__enqueue_loc_2), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor__enqueue_loc_3, __pyx_k_AsyncCacheProcessor__enqueue_loc_3, sizeof(__pyx_k_AsyncCacheProcessor__enqueue_loc_3), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_add, __pyx_k_AsyncCacheProcessor_add, sizeof(__pyx_k_AsyncCacheProcessor_add), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_bound, __pyx_k_AsyncCacheProcessor_bound, sizeof(__pyx_k_AsyncCacheProcessor_bound), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_capacity, __pyx_k_AsyncCacheProcessor_capacity, sizeof(__pyx_k_AsyncCacheProcessor_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_clear, __pyx_k_AsyncCacheProcessor_clear, sizeof(__pyx_k_AsyncCacheProcessor_clear), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_contains, __pyx_k_AsyncCacheProcessor_contains, sizeof(__pyx_k_AsyncCacheProcessor_contains), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_delete, __pyx_k_AsyncCacheProcessor_delete, sizeof(__pyx_k_AsyncCacheProcessor_delete), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_do_async, __pyx_k_AsyncCacheProcessor_do_async, sizeof(__pyx_k_AsyncCacheProcessor_do_async), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_do_async_coa, __pyx_k_AsyncCacheProcessor_do_async_coa, sizeof(__pyx_k_AsyncCacheProcessor_do_async_coa), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_expire, __pyx_k_AsyncCacheProcessor_expire, sizeof(__pyx_k_AsyncCacheProcessor_expire), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_get, __pyx_k_AsyncCacheProcessor_get, sizeof(__pyx_k_AsyncCacheProcessor_get), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_getTtl, __pyx_k_AsyncCacheProcessor_getTtl, sizeof(__pyx_k_AsyncCacheProcessor_getTtl), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_purge, __pyx_k_AsyncCacheProcessor_purge, sizeof(__pyx_k_AsyncCacheProcessor_purge), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_put, __pyx_k_AsyncCacheProcessor_put, sizeof(__pyx_k_AsyncCacheProcessor_put), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_queuelen, __pyx_k_AsyncCacheProcessor_queuelen, sizeof(__pyx_k_AsyncCacheProcessor_queuelen), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_register_cle, __pyx_k_AsyncCacheProcessor_register_cle, sizeof(__pyx_k_AsyncCacheProcessor_register_cle), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_register_def, __pyx_k_AsyncCacheProcessor_register_def, sizeof(__pyx_k_AsyncCacheProcessor_register_def), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_renew, __pyx_k_AsyncCacheProcessor_renew, sizeof(__pyx_k_AsyncCacheProcessor_renew), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_threadpool, __pyx_k_AsyncCacheProcessor_threadpool, sizeof(__pyx_k_AsyncCacheProcessor_threadpool), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheProcessor_usage, __pyx_k_AsyncCacheProcessor_usage, sizeof(__pyx_k_AsyncCacheProcessor_usage), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool, __pyx_k_AsyncCacheWriterPool, sizeof(__pyx_k_AsyncCacheWriterPool), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool___init, __pyx_k_AsyncCacheWriterPool___init, sizeof(__pyx_k_AsyncCacheWriterPool___init), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool__coalesce, __pyx_k_AsyncCacheWriterPool__coalesce, sizeof(__pyx_k_AsyncCacheWriterPool__coalesce), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool__contains, __pyx_k_AsyncCacheWriterPool__contains, sizeof(__pyx_k_AsyncCacheWriterPool__contains), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool__enqueue, __pyx_k_AsyncCacheWriterPool__enqueue, sizeof(__pyx_k_AsyncCacheWriterPool__enqueue), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool__writer, __pyx_k_AsyncCacheWriterPool__writer, sizeof(__pyx_k_AsyncCacheWriterPool__writer), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_capacity, __pyx_k_AsyncCacheWriterPool_capacity, sizeof(__pyx_k_AsyncCacheWriterPool_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_clear, __pyx_k_AsyncCacheWriterPool_clear, sizeof(__pyx_k_AsyncCacheWriterPool_clear), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_clearqueue, __pyx_k_AsyncCacheWriterPool_clearqueue, sizeof(__pyx_k_AsyncCacheWriterPool_clearqueue), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_contains, __pyx_k_AsyncCacheWriterPool_contains, sizeof(__pyx_k_AsyncCacheWriterPool_contains), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_defer_threa, __pyx_k_AsyncCacheWriterPool_defer_threa, sizeof(__pyx_k_AsyncCacheWriterPool_defer_threa), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_delete, __pyx_k_AsyncCacheWriterPool_delete, sizeof(__pyx_k_AsyncCacheWriterPool_delete), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_dequeue, __pyx_k_AsyncCacheWriterPool_dequeue, sizeof(__pyx_k_AsyncCacheWriterPool_dequeue), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_drop_one, __pyx_k_AsyncCacheWriterPool_drop_one, sizeof(__pyx_k_AsyncCacheWriterPool_drop_one), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_enqueue, __pyx_k_AsyncCacheWriterPool_enqueue, sizeof(__pyx_k_AsyncCacheWriterPool_enqueue), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_expire, __pyx_k_AsyncCacheWriterPool_expire, sizeof(__pyx_k_AsyncCacheWriterPool_expire), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_getTtl, __pyx_k_AsyncCacheWriterPool_getTtl, sizeof(__pyx_k_AsyncCacheWriterPool_getTtl), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_purge, __pyx_k_AsyncCacheWriterPool_purge, sizeof(__pyx_k_AsyncCacheWriterPool_purge), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_put, __pyx_k_AsyncCacheWriterPool_put, sizeof(__pyx_k_AsyncCacheWriterPool_put), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_register_cl, __pyx_k_AsyncCacheWriterPool_register_cl, sizeof(__pyx_k_AsyncCacheWriterPool_register_cl), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_register_de, __pyx_k_AsyncCacheWriterPool_register_de, sizeof(__pyx_k_AsyncCacheWriterPool_register_de), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_renew, __pyx_k_AsyncCacheWriterPool_renew, sizeof(__pyx_k_AsyncCacheWriterPool_renew), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_usage, __pyx_k_AsyncCacheWriterPool_usage, sizeof(__pyx_k_AsyncCacheWriterPool_usage), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_waitkey, __pyx_k_AsyncCacheWriterPool_waitkey, sizeof(__pyx_k_AsyncCacheWriterPool_waitkey), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterPool_writer_thre, __pyx_k_AsyncCacheWriterPool_writer_thre, sizeof(__pyx_k_AsyncCacheWriterPool_writer_thre), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterThread, __pyx_k_AsyncCacheWriterThread, sizeof(__pyx_k_AsyncCacheWriterThread), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterThreadPool, __pyx_k_AsyncCacheWriterThreadPool, sizeof(__pyx_k_AsyncCacheWriterThreadPool), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterThreadPool_Async, __pyx_k_AsyncCacheWriterThreadPool_Async, sizeof(__pyx_k_AsyncCacheWriterThreadPool_Async), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncCacheWriterThreadPool___ini, __pyx_k_AsyncCacheWriterThreadPool___ini, sizeof(__pyx_k_AsyncCacheWriterThreadPool___ini), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient, __pyx_k_AsyncWriteCacheClient, sizeof(__pyx_k_AsyncWriteCacheClient), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient___init, __pyx_k_AsyncWriteCacheClient___init, sizeof(__pyx_k_AsyncWriteCacheClient___init), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient___repr, __pyx_k_AsyncWriteCacheClient___repr, sizeof(__pyx_k_AsyncWriteCacheClient___repr), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient___str, __pyx_k_AsyncWriteCacheClient___str, sizeof(__pyx_k_AsyncWriteCacheClient___str), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_assert_sta, __pyx_k_AsyncWriteCacheClient_assert_sta, sizeof(__pyx_k_AsyncWriteCacheClient_assert_sta), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_async, __pyx_k_AsyncWriteCacheClient_async, sizeof(__pyx_k_AsyncWriteCacheClient_async), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_capacity, __pyx_k_AsyncWriteCacheClient_capacity, sizeof(__pyx_k_AsyncWriteCacheClient_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_clear, __pyx_k_AsyncWriteCacheClient_clear, sizeof(__pyx_k_AsyncWriteCacheClient_clear), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_contains, __pyx_k_AsyncWriteCacheClient_contains, sizeof(__pyx_k_AsyncWriteCacheClient_contains), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_delete, __pyx_k_AsyncWriteCacheClient_delete, sizeof(__pyx_k_AsyncWriteCacheClient_delete), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_expire, __pyx_k_AsyncWriteCacheClient_expire, sizeof(__pyx_k_AsyncWriteCacheClient_expire), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_get, __pyx_k_AsyncWriteCacheClient_get, sizeof(__pyx_k_AsyncWriteCacheClient_get), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_getMulti, __pyx_k_AsyncWriteCacheClient_getMulti, sizeof(__pyx_k_AsyncWriteCacheClient_getMulti), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_getTtl, __pyx_k_AsyncWriteCacheClient_getTtl, sizeof(__pyx_k_AsyncWriteCacheClient_getTtl), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_getTtlMult, __pyx_k_AsyncWriteCacheClient_getTtlMult, sizeof(__pyx_k_AsyncWriteCacheClient_getTtlMult), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_is_started, __pyx_k_AsyncWriteCacheClient_is_started, sizeof(__pyx_k_AsyncWriteCacheClient_is_started), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_promote, __pyx_k_AsyncWriteCacheClient_promote, sizeof(__pyx_k_AsyncWriteCacheClient_promote), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_purge, __pyx_k_AsyncWriteCacheClient_purge, sizeof(__pyx_k_AsyncWriteCacheClient_purge), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_put, __pyx_k_AsyncWriteCacheClient_put, sizeof(__pyx_k_AsyncWriteCacheClient_put), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_register_c, __pyx_k_AsyncWriteCacheClient_register_c, sizeof(__pyx_k_AsyncWriteCacheClient_register_c), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_renew, __pyx_k_AsyncWriteCacheClient_renew, sizeof(__pyx_k_AsyncWriteCacheClient_renew), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_start, __pyx_k_AsyncWriteCacheClient_start, sizeof(__pyx_k_AsyncWriteCacheClient_start), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_stop, __pyx_k_AsyncWriteCacheClient_stop, sizeof(__pyx_k_AsyncWriteCacheClient_stop), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_usage, __pyx_k_AsyncWriteCacheClient_usage, sizeof(__pyx_k_AsyncWriteCacheClient_usage), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncWriteCacheClient_wait, __pyx_k_AsyncWriteCacheClient_wait, sizeof(__pyx_k_AsyncWriteCacheClient_wait), 0, 0, 1, 1},
  {&__pyx_n_s_BaseCacheClient, __pyx_k_BaseCacheClient, sizeof(__pyx_k_BaseCacheClient), 0, 0, 1, 1},
  {&__pyx_n_s_CLEAR, __pyx_k_CLEAR, sizeof(__pyx_k_CLEAR), 0, 0, 1, 1},
  {&__pyx_n_s_COALESCE_IGNORE_KWARGS, __pyx_k_COALESCE_IGNORE_KWARGS, sizeof(__pyx_k_COALESCE_IGNORE_KWARGS), 0, 0, 1, 1},
  {&__pyx_n_s_Cache, __pyx_k_Cache, sizeof(__pyx_k_Cache), 0, 0, 1, 1},
  {&__pyx_n_s_CacheMissError, __pyx_k_CacheMissError, sizeof(__pyx_k_CacheMissError), 0, 0, 1, 1},
  {&__pyx_n_s_CancelledError, __pyx_k_CancelledError, sizeof(__pyx_k_CancelledError), 0, 0, 1, 1},
  {&__pyx_n_s_DELETE, __pyx_k_DELETE, sizeof(__pyx_k_DELETE), 0, 0, 1, 1},
  {&__pyx_n_s_Defer, __pyx_k_Defer, sizeof(__pyx_k_Defer), 0, 0, 1, 1},
  {&__pyx_n_s_Defer___init, __pyx_k_Defer___init, sizeof(__pyx_k_Defer___init), 0, 0, 1, 1},
  {&__pyx_n_s_Defer_done, __pyx_k_Defer_done, sizeof(__pyx_k_Defer_done), 0, 0, 1, 1},
  {&__pyx_n_s_Defer_set, __pyx_k_Defer_set, sizeof(__pyx_k_Defer_set), 0, 0, 1, 1},
  {&__pyx_n_s_Defer_undefer, __pyx_k_Defer_undefer, sizeof(__pyx_k_Defer_undefer), 0, 0, 1, 1},
  {&__pyx_n_s_EXPIRE, __pyx_k_EXPIRE, sizeof(__pyx_k_EXPIRE), 0, 0, 1, 1},
  {&__pyx_kp_s_Error_clearing_cache, __pyx_k_Error_clearing_cache, sizeof(__pyx_k_Error_clearing_cache), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_deleting_key, __pyx_k_Error_deleting_key, sizeof(__pyx_k_Error_deleting_key), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_during_background_thread_c, __pyx_k_Error_during_background_thread_c, sizeof(__pyx_k_Error_during_background_thread_c), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_during_cleanup, __pyx_k_Error_during_cleanup, sizeof(__pyx_k_Error_during_cleanup), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_expiring_key, __pyx_k_Error_expiring_key, sizeof(__pyx_k_Error_expiring_key), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_in_async_callback, __pyx_k_Error_in_async_callback, sizeof(__pyx_k_Error_in_async_callback), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_in_background_cache_refres, __pyx_k_Error_in_background_cache_refres, sizeof(__pyx_k_Error_in_background_cache_refres), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_purging_cache, __pyx_k_Error_purging_cache, sizeof(__pyx_k_Error_purging_cache), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_renewing_key, __pyx_k_Error_renewing_key, sizeof(__pyx_k_Error_renewing_key), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_saving_data_in_cache_r_key, __pyx_k_Error_saving_data_in_cache_r_key, sizeof(__pyx_k_Error_saving_data_in_cache_r_key), 0, 0, 1, 0},
  {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1},
  {&__pyx_n_s_ExceptionWrapper, __pyx_k_ExceptionWrapper, sizeof(__pyx_k_ExceptionWrapper), 0, 0, 1, 1},
  {&__pyx_n_s_ExceptionWrapper___init, __pyx_k_ExceptionWrapper___init, sizeof(__pyx_k_ExceptionWrapper___init), 0, 0, 1, 1},
  {&__pyx_n_s_ExceptionWrapper_reraise, __pyx_k_ExceptionWrapper_reraise, sizeof(__pyx_k_ExceptionWrapper_reraise), 0, 0, 1, 1},
  {&__pyx_kp_s_Found_zombie_task_in_coalesce_bu, __pyx_k_Found_zombie_task_in_coalesce_bu, sizeof(__pyx_k_Found_zombie_task_in_coalesce_bu), 0, 0, 1, 0},
  {&__pyx_n_s_Future, __pyx_k_Future, sizeof(__pyx_k_Future), 0, 0, 1, 1},
  {&__pyx_n_s_Future___init, __pyx_k_Future___init, sizeof(__pyx_k_Future___init), 0, 0, 1, 1},
  {&__pyx_n_s_Future__exc_nothreads, __pyx_k_Future__exc_nothreads, sizeof(__pyx_k_Future__exc_nothreads), 0, 0, 1, 1},
  {&__pyx_n_s_Future__miss_nothreads, __pyx_k_Future__miss_nothreads, sizeof(__pyx_k_Future__miss_nothreads), 0, 0, 1, 1},
  {&__pyx_n_s_Future__on_stuff, __pyx_k_Future__on_stuff, sizeof(__pyx_k_Future__on_stuff), 0, 0, 1, 1},
  {&__pyx_n_s_Future__set_nothreads, __pyx_k_Future__set_nothreads, sizeof(__pyx_k_Future__set_nothreads), 0, 0, 1, 1},
  {&__pyx_n_s_Future_add_done_callback, __pyx_k_Future_add_done_callback, sizeof(__pyx_k_Future_add_done_callback), 0, 0, 1, 1},
  {&__pyx_n_s_Future_add_done_callback_locals, __pyx_k_Future_add_done_callback_locals, sizeof(__pyx_k_Future_add_done_callback_locals), 0, 0, 1, 1},
  {&__pyx_n_s_Future_cancel, __pyx_k_Future_cancel, sizeof(__pyx_k_Future_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_Future_cancel_pending, __pyx_k_Future_cancel_pending, sizeof(__pyx_k_Future_cancel_pending), 0, 0, 1, 1},
  {&__pyx_n_s_Future_cancelled, __pyx_k_Future_cancelled, sizeof(__pyx_k_Future_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_Future_chain, __pyx_k_Future_chain, sizeof(__pyx_k_Future_chain), 0, 0, 1, 1},
  {&__pyx_n_s_Future_chain_std, __pyx_k_Future_chain_std, sizeof(__pyx_k_Future_chain_std), 0, 0, 1, 1},
  {&__pyx_n_s_Future_chain_std_locals_lambda, __pyx_k_Future_chain_std_locals_lambda, sizeof(__pyx_k_Future_chain_std_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_Future_done, __pyx_k_Future_done, sizeof(__pyx_k_Future_done), 0, 0, 1, 1},
  {&__pyx_n_s_Future_exc, __pyx_k_Future_exc, sizeof(__pyx_k_Future_exc), 0, 0, 1, 1},
  {&__pyx_n_s_Future_exception, __pyx_k_Future_exception, sizeof(__pyx_k_Future_exception), 0, 0, 1, 1},
  {&__pyx_n_s_Future_miss, __pyx_k_Future_miss, sizeof(__pyx_k_Future_miss), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_any, __pyx_k_Future_on_any, sizeof(__pyx_k_Future_on_any), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_any_locals_callback, __pyx_k_Future_on_any_locals_callback, sizeof(__pyx_k_Future_on_any_locals_callback), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_any_once, __pyx_k_Future_on_any_once, sizeof(__pyx_k_Future_on_any_once), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_done, __pyx_k_Future_on_done, sizeof(__pyx_k_Future_on_done), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_done_locals_done_callb, __pyx_k_Future_on_done_locals_done_callb, sizeof(__pyx_k_Future_on_done_locals_done_callb), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_exc, __pyx_k_Future_on_exc, sizeof(__pyx_k_Future_on_exc), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_exc_locals_exc_callbac, __pyx_k_Future_on_exc_locals_exc_callbac, sizeof(__pyx_k_Future_on_exc_locals_exc_callbac), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_miss, __pyx_k_Future_on_miss, sizeof(__pyx_k_Future_on_miss), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_miss_locals_miss_callb, __pyx_k_Future_on_miss_locals_miss_callb, sizeof(__pyx_k_Future_on_miss_locals_miss_callb), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_value, __pyx_k_Future_on_value, sizeof(__pyx_k_Future_on_value), 0, 0, 1, 1},
  {&__pyx_n_s_Future_on_value_locals_value_cal, __pyx_k_Future_on_value_locals_value_cal, sizeof(__pyx_k_Future_on_value_locals_value_cal), 0, 0, 1, 1},
  {&__pyx_n_s_Future_result, __pyx_k_Future_result, sizeof(__pyx_k_Future_result), 0, 0, 1, 1},
  {&__pyx_n_s_Future_running, __pyx_k_Future_running, sizeof(__pyx_k_Future_running), 0, 0, 1, 1},
  {&__pyx_n_s_Future_set, __pyx_k_Future_set, sizeof(__pyx_k_Future_set), 0, 0, 1, 1},
  {&__pyx_n_s_Future_set_exception, __pyx_k_Future_set_exception, sizeof(__pyx_k_Future_set_exception), 0, 0, 1, 1},
  {&__pyx_n_s_Future_set_running_or_notify_can, __pyx_k_Future_set_running_or_notify_can, sizeof(__pyx_k_Future_set_running_or_notify_can), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1},
  {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1},
  {&__pyx_n_s_NONE_2, __pyx_k_NONE_2, sizeof(__pyx_k_NONE_2), 0, 0, 1, 1},
  {&__pyx_n_s_PURGE, __pyx_k_PURGE, sizeof(__pyx_k_PURGE), 0, 0, 1, 1},
  {&__pyx_n_s_Process, __pyx_k_Process, sizeof(__pyx_k_Process), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats, __pyx_k_ProcessorStats, sizeof(__pyx_k_ProcessorStats), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats___init, __pyx_k_ProcessorStats___init, sizeof(__pyx_k_ProcessorStats___init), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats_on_task_cancelled, __pyx_k_ProcessorStats_on_task_cancelled, sizeof(__pyx_k_ProcessorStats_on_task_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats_on_task_completed, __pyx_k_ProcessorStats_on_task_completed, sizeof(__pyx_k_ProcessorStats_on_task_completed), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats_on_task_queued, __pyx_k_ProcessorStats_on_task_queued, sizeof(__pyx_k_ProcessorStats_on_task_queued), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats_on_task_started, __pyx_k_ProcessorStats_on_task_started, sizeof(__pyx_k_ProcessorStats_on_task_started), 0, 0, 1, 1},
  {&__pyx_n_s_ProcessorStats_reset, __pyx_k_ProcessorStats_reset, sizeof(__pyx_k_ProcessorStats_reset), 0, 0, 1, 1},
  {&__pyx_n_s_REGET, __pyx_k_REGET, sizeof(__pyx_k_REGET), 0, 0, 1, 1},
  {&__pyx_n_s_RENEW, __pyx_k_RENEW, sizeof(__pyx_k_RENEW), 0, 0, 1, 1},
  {&__pyx_n_s_SPECIAL, __pyx_k_SPECIAL, sizeof(__pyx_k_SPECIAL), 0, 0, 1, 1},
  {&__pyx_kp_s_Starting_AsyncCacheClient_twice, __pyx_k_Starting_AsyncCacheClient_twice, sizeof(__pyx_k_Starting_AsyncCacheClient_twice), 0, 0, 1, 0},
  {&__pyx_n_s_ThreadPool, __pyx_k_ThreadPool, sizeof(__pyx_k_ThreadPool), 0, 0, 1, 1},
  {&__pyx_n_s_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 0, 1, 1},
  {&__pyx_n_s_WeakKeyDictionary, __pyx_k_WeakKeyDictionary, sizeof(__pyx_k_WeakKeyDictionary), 0, 0, 1, 1},
  {&__pyx_kp_s_Wrap_a_callable_in_this_and_pas, __pyx_k_Wrap_a_callable_in_this_and_pas, sizeof(__pyx_k_Wrap_a_callable_in_this_and_pas), 0, 0, 1, 0},
  {&__pyx_n_s_WrappedCacheProcessor, __pyx_k_WrappedCacheProcessor, sizeof(__pyx_k_WrappedCacheProcessor), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor___init, __pyx_k_WrappedCacheProcessor___init, sizeof(__pyx_k_WrappedCacheProcessor___init), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_add, __pyx_k_WrappedCacheProcessor_add, sizeof(__pyx_k_WrappedCacheProcessor_add), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_bound, __pyx_k_WrappedCacheProcessor_bound, sizeof(__pyx_k_WrappedCacheProcessor_bound), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_capacity, __pyx_k_WrappedCacheProcessor_capacity, sizeof(__pyx_k_WrappedCacheProcessor_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_clear, __pyx_k_WrappedCacheProcessor_clear, sizeof(__pyx_k_WrappedCacheProcessor_clear), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_contains, __pyx_k_WrappedCacheProcessor_contains, sizeof(__pyx_k_WrappedCacheProcessor_contains), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_delete, __pyx_k_WrappedCacheProcessor_delete, sizeof(__pyx_k_WrappedCacheProcessor_delete), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_do_async, __pyx_k_WrappedCacheProcessor_do_async, sizeof(__pyx_k_WrappedCacheProcessor_do_async), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_expire, __pyx_k_WrappedCacheProcessor_expire, sizeof(__pyx_k_WrappedCacheProcessor_expire), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_get, __pyx_k_WrappedCacheProcessor_get, sizeof(__pyx_k_WrappedCacheProcessor_get), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_getTtl, __pyx_k_WrappedCacheProcessor_getTtl, sizeof(__pyx_k_WrappedCacheProcessor_getTtl), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_maxqueue, __pyx_k_WrappedCacheProcessor_maxqueue, sizeof(__pyx_k_WrappedCacheProcessor_maxqueue), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_purge, __pyx_k_WrappedCacheProcessor_purge, sizeof(__pyx_k_WrappedCacheProcessor_purge), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_put, __pyx_k_WrappedCacheProcessor_put, sizeof(__pyx_k_WrappedCacheProcessor_put), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_queuelen, __pyx_k_WrappedCacheProcessor_queuelen, sizeof(__pyx_k_WrappedCacheProcessor_queuelen), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_register_c, __pyx_k_WrappedCacheProcessor_register_c, sizeof(__pyx_k_WrappedCacheProcessor_register_c), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_register_d, __pyx_k_WrappedCacheProcessor_register_d, sizeof(__pyx_k_WrappedCacheProcessor_register_d), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_renew, __pyx_k_WrappedCacheProcessor_renew, sizeof(__pyx_k_WrappedCacheProcessor_renew), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_stats, __pyx_k_WrappedCacheProcessor_stats, sizeof(__pyx_k_WrappedCacheProcessor_stats), 0, 0, 1, 1},
  {&__pyx_n_s_WrappedCacheProcessor_usage, __pyx_k_WrappedCacheProcessor_usage, sizeof(__pyx_k_WrappedCacheProcessor_usage), 0, 0, 1, 1},
  {&__pyx_n_s_WrapperFuture, __pyx_k_WrapperFuture, sizeof(__pyx_k_WrapperFuture), 0, 0, 1, 1},
  {&__pyx_n_s_WrapperFuture__wrapped, __pyx_k_WrapperFuture__wrapped, sizeof(__pyx_k_WrapperFuture__wrapped), 0, 0, 1, 1},
  {&__pyx_kp_s_Wraps_an_AsyncCacheProcessor_bi, __pyx_k_Wraps_an_AsyncCacheProcessor_bi, sizeof(__pyx_k_Wraps_an_AsyncCacheProcessor_bi), 0, 0, 1, 0},
  {&__pyx_n_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 1},
  {&__pyx_n_s__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 0, 1, 1},
  {&__pyx_n_s_abort_tasks, __pyx_k_abort_tasks, sizeof(__pyx_k_abort_tasks), 0, 0, 1, 1},
  {&__pyx_n_s_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_done_callback, __pyx_k_add_done_callback, sizeof(__pyx_k_add_done_callback), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_apply_async, __pyx_k_apply_async, sizeof(__pyx_k_apply_async), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_assert_started, __pyx_k_assert_started, sizeof(__pyx_k_assert_started), 0, 0, 1, 1},
  {&__pyx_n_s_async, __pyx_k_async, sizeof(__pyx_k_async), 0, 0, 1, 1},
  {&__pyx_n_s_async_2, __pyx_k_async_2, sizeof(__pyx_k_async_2), 0, 0, 1, 1},
  {&__pyx_kp_s_async_extension_module_not_buil, __pyx_k_async_extension_module_not_buil, sizeof(__pyx_k_async_extension_module_not_buil), 0, 0, 1, 0},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bound, __pyx_k_bound, sizeof(__pyx_k_bound), 0, 0, 1, 1},
  {&__pyx_n_s_busyloop, __pyx_k_busyloop, sizeof(__pyx_k_busyloop), 0, 0, 1, 1},
  {&__pyx_n_s_callable, __pyx_k_callable, sizeof(__pyx_k_callable), 0, 0, 1, 1},
  {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
  {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_cancel_pending, __pyx_k_cancel_pending, sizeof(__pyx_k_cancel_pending), 0, 0, 1, 1},
  {&__pyx_n_s_cancel_pending_2, __pyx_k_cancel_pending_2, sizeof(__pyx_k_cancel_pending_2), 0, 0, 1, 1},
  {&__pyx_n_s_cancelled, __pyx_k_cancelled, sizeof(__pyx_k_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_cancelled_2, __pyx_k_cancelled_2, sizeof(__pyx_k_cancelled_2), 0, 0, 1, 1},
  {&__pyx_n_s_capacity, __pyx_k_capacity, sizeof(__pyx_k_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_cb, __pyx_k_cb, sizeof(__pyx_k_cb), 0, 0, 1, 1},
  {&__pyx_n_s_cb_2, __pyx_k_cb_2, sizeof(__pyx_k_cb_2), 0, 0, 1, 1},
  {&__pyx_n_s_cbap, __pyx_k_cbap, sizeof(__pyx_k_cbap), 0, 0, 1, 1},
  {&__pyx_n_s_cbs, __pyx_k_cbs, sizeof(__pyx_k_cbs), 0, 0, 1, 1},
  {&__pyx_n_s_cfuture, __pyx_k_cfuture, sizeof(__pyx_k_cfuture), 0, 0, 1, 1},
  {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
  {&__pyx_n_s_chain_std, __pyx_k_chain_std, sizeof(__pyx_k_chain_std), 0, 0, 1, 1},
  {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
  {&__pyx_n_s_chorde, __pyx_k_chorde, sizeof(__pyx_k_chorde), 0, 0, 1, 1},
  {&__pyx_kp_s_chorde_async, __pyx_k_chorde_async, sizeof(__pyx_k_chorde_async), 0, 0, 1, 0},
  {&__pyx_n_s_chorde_clients_async, __pyx_k_chorde_clients_async, sizeof(__pyx_k_chorde_clients_async), 0, 0, 1, 1},
  {&__pyx_n_s_chorde_serialize, __pyx_k_chorde_serialize, sizeof(__pyx_k_chorde_serialize), 0, 0, 1, 1},
  {&__pyx_n_s_chorde_threadpool, __pyx_k_chorde_threadpool, sizeof(__pyx_k_chorde_threadpool), 0, 0, 1, 1},
  {&__pyx_n_s_ckey, __pyx_k_ckey, sizeof(__pyx_k_ckey), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clean, __pyx_k_clean, sizeof(__pyx_k_clean), 0, 0, 1, 1},
  {&__pyx_n_s_clean_coalesce, __pyx_k_clean_coalesce, sizeof(__pyx_k_clean_coalesce), 0, 0, 1, 1},
  {&__pyx_n_s_cleaned_coalesce, __pyx_k_cleaned_coalesce, sizeof(__pyx_k_cleaned_coalesce), 0, 0, 1, 1},
  {&__pyx_n_s_cleanup_cycles, __pyx_k_cleanup_cycles, sizeof(__pyx_k_cleanup_cycles), 0, 0, 1, 1},
  {&__pyx_n_s_cleanup_tasks, __pyx_k_cleanup_tasks, sizeof(__pyx_k_cleanup_tasks), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clearqueue, __pyx_k_clearqueue, sizeof(__pyx_k_clearqueue), 0, 0, 1, 1},
  {&__pyx_n_s_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_coalesce, __pyx_k_coalesce, sizeof(__pyx_k_coalesce), 0, 0, 1, 1},
  {&__pyx_n_s_coalesce_2, __pyx_k_coalesce_2, sizeof(__pyx_k_coalesce_2), 0, 0, 1, 1},
  {&__pyx_n_s_coalesce_contains, __pyx_k_coalesce_contains, sizeof(__pyx_k_coalesce_contains), 0, 0, 1, 1},
  {&__pyx_n_s_coalesce_get, __pyx_k_coalesce_get, sizeof(__pyx_k_coalesce_get), 0, 0, 1, 1},
  {&__pyx_n_s_coalesce_getTtl, __pyx_k_coalesce_getTtl, sizeof(__pyx_k_coalesce_getTtl), 0, 0, 1, 1},
  {&__pyx_n_s_coalesce_key, __pyx_k_coalesce_key, sizeof(__pyx_k_coalesce_key), 0, 0, 1, 1},
  {&__pyx_n_s_coalescence_buffer_size, __pyx_k_coalescence_buffer_size, sizeof(__pyx_k_coalescence_buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
  {&__pyx_n_s_contains_2, __pyx_k_contains_2, sizeof(__pyx_k_contains_2), 0, 0, 1, 1},
  {&__pyx_n_s_contains_3, __pyx_k_contains_3, sizeof(__pyx_k_contains_3), 0, 0, 1, 1},
  {&__pyx_n_s_cpu_count, __pyx_k_cpu_count, sizeof(__pyx_k_cpu_count), 0, 0, 1, 1},
  {&__pyx_n_s_current, __pyx_k_current, sizeof(__pyx_k_current), 0, 0, 1, 1},
  {&__pyx_n_s_current_process, __pyx_k_current_process, sizeof(__pyx_k_current_process), 0, 0, 1, 1},
  {&__pyx_n_s_cwaction, __pyx_k_cwaction, sizeof(__pyx_k_cwaction), 0, 0, 1, 1},
  {&__pyx_n_s_cycle, __pyx_k_cycle, sizeof(__pyx_k_cycle), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_default_rv, __pyx_k_default_rv, sizeof(__pyx_k_default_rv), 0, 0, 1, 1},
  {&__pyx_n_s_defer, __pyx_k_defer, sizeof(__pyx_k_defer), 0, 0, 1, 1},
  {&__pyx_n_s_defer_threadpool, __pyx_k_defer_threadpool, sizeof(__pyx_k_defer_threadpool), 0, 0, 1, 1},
  {&__pyx_n_s_defer_threadpool_2, __pyx_k_defer_threadpool_2, sizeof(__pyx_k_defer_threadpool_2), 0, 0, 1, 1},
  {&__pyx_n_s_defer_threadpool_factory, __pyx_k_defer_threadpool_factory, sizeof(__pyx_k_defer_threadpool_factory), 0, 0, 1, 1},
  {&__pyx_n_s_deferred, __pyx_k_deferred, sizeof(__pyx_k_deferred), 0, 0, 1, 1},
  {&__pyx_n_s_delayed, __pyx_k_delayed, sizeof(__pyx_k_delayed), 0, 0, 1, 1},
  {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
  {&__pyx_n_s_dequeue, __pyx_k_dequeue, sizeof(__pyx_k_dequeue), 0, 0, 1, 1},
  {&__pyx_n_s_dirty_rounds, __pyx_k_dirty_rounds, sizeof(__pyx_k_dirty_rounds), 0, 0, 1, 1},
  {&__pyx_n_s_do_async, __pyx_k_do_async, sizeof(__pyx_k_do_async), 0, 0, 1, 1},
  {&__pyx_n_s_do_async_coalescent, __pyx_k_do_async_coalescent, sizeof(__pyx_k_do_async_coalescent), 0, 0, 1, 1},
  {&__pyx_n_s_do_coalescence, __pyx_k_do_coalescence, sizeof(__pyx_k_do_coalescence), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_docall, __pyx_k_docall, sizeof(__pyx_k_docall), 0, 0, 1, 1},
  {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1},
  {&__pyx_n_s_done_callback, __pyx_k_done_callback, sizeof(__pyx_k_done_callback), 0, 0, 1, 1},
  {&__pyx_n_s_done_event, __pyx_k_done_event, sizeof(__pyx_k_done_event), 0, 0, 1, 1},
  {&__pyx_n_s_done_event_2, __pyx_k_done_event_2, sizeof(__pyx_k_done_event_2), 0, 0, 1, 1},
  {&__pyx_n_s_drop_one, __pyx_k_drop_one, sizeof(__pyx_k_drop_one), 0, 0, 1, 1},
  {&__pyx_n_s_dummy, __pyx_k_dummy, sizeof(__pyx_k_dummy), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_enqueue, __pyx_k_enqueue, sizeof(__pyx_k_enqueue), 0, 0, 1, 1},
  {&__pyx_n_s_enqueue_2, __pyx_k_enqueue_2, sizeof(__pyx_k_enqueue_2), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_ettl, __pyx_k_ettl, sizeof(__pyx_k_ettl), 0, 0, 1, 1},
  {&__pyx_n_s_ettl_append, __pyx_k_ettl_append, sizeof(__pyx_k_ettl_append), 0, 0, 1, 1},
  {&__pyx_n_s_ettlget, __pyx_k_ettlget, sizeof(__pyx_k_ettlget), 0, 0, 1, 1},
  {&__pyx_n_s_ev, __pyx_k_ev, sizeof(__pyx_k_ev), 0, 0, 1, 1},
  {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1},
  {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1},
  {&__pyx_n_s_exc_callback, __pyx_k_exc_callback, sizeof(__pyx_k_exc_callback), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_exc_nothreads, __pyx_k_exc_nothreads, sizeof(__pyx_k_exc_nothreads), 0, 0, 1, 1},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_expire, __pyx_k_expire, sizeof(__pyx_k_expire), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  {&__pyx_n_s_future, __pyx_k_future, sizeof(__pyx_k_future), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
  {&__pyx_n_s_getMulti, __pyx_k_getMulti, sizeof(__pyx_k_getMulti), 0, 0, 1, 1},
  {&__pyx_n_s_getTtl, __pyx_k_getTtl, sizeof(__pyx_k_getTtl), 0, 0, 1, 1},
  {&__pyx_n_s_getTtlMulti, __pyx_k_getTtlMulti, sizeof(__pyx_k_getTtlMulti), 0, 0, 1, 1},
  {&__pyx_n_s_get_ident, __pyx_k_get_ident, sizeof(__pyx_k_get_ident), 0, 0, 1, 1},
  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {&__pyx_n_s_global_cleanup_tasks, __pyx_k_global_cleanup_tasks, sizeof(__pyx_k_global_cleanup_tasks), 0, 0, 1, 1},
  {&__pyx_n_s_hasattr, __pyx_k_hasattr, sizeof(__pyx_k_hasattr), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_worker, __pyx_k_in_worker, sizeof(__pyx_k_in_worker), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_inproc, __pyx_k_inproc, sizeof(__pyx_k_inproc), 0, 0, 1, 1},
  {&__pyx_n_s_isSet, __pyx_k_isSet, sizeof(__pyx_k_isSet), 0, 0, 1, 1},
  {&__pyx_n_s_is_special, __pyx_k_is_special, sizeof(__pyx_k_is_special), 0, 0, 1, 1},
  {&__pyx_n_s_is_started, __pyx_k_is_started, sizeof(__pyx_k_is_started), 0, 0, 1, 1},
  {&__pyx_n_s_isinstance, __pyx_k_isinstance, sizeof(__pyx_k_isinstance), 0, 0, 1, 1},
  {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_kev, __pyx_k_kev, sizeof(__pyx_k_kev), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_lazy, __pyx_k_lazy, sizeof(__pyx_k_lazy), 0, 0, 1, 1},
  {&__pyx_kp_s_lib_chorde_clients_async_py, __pyx_k_lib_chorde_clients_async_py, sizeof(__pyx_k_lib_chorde_clients_async_py), 0, 0, 1, 0},
  {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1},
  {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1},
  {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
  {&__pyx_n_s_logger_2, __pyx_k_logger_2, sizeof(__pyx_k_logger_2), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_makeFutureWrapper, __pyx_k_makeFutureWrapper, sizeof(__pyx_k_makeFutureWrapper), 0, 0, 1, 1},
  {&__pyx_n_s_makeFutureWrapper_locals_Wrapper, __pyx_k_makeFutureWrapper_locals_Wrapper, sizeof(__pyx_k_makeFutureWrapper_locals_Wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_makeFutureWrapper_locals_Wrapper_2, __pyx_k_makeFutureWrapper_locals_Wrapper_2, sizeof(__pyx_k_makeFutureWrapper_locals_Wrapper_2), 0, 0, 1, 1},
  {&__pyx_n_s_makeFutureWrapper_locals_Wrapper_3, __pyx_k_makeFutureWrapper_locals_Wrapper_3, sizeof(__pyx_k_makeFutureWrapper_locals_Wrapper_3), 0, 0, 1, 1},
  {&__pyx_n_s_makeFutureWrapper_locals_Wrapper_4, __pyx_k_makeFutureWrapper_locals_Wrapper_4, sizeof(__pyx_k_makeFutureWrapper_locals_Wrapper_4), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_maxqueue, __pyx_k_maxqueue, sizeof(__pyx_k_maxqueue), 0, 0, 1, 1},
  {&__pyx_n_s_me, __pyx_k_me, sizeof(__pyx_k_me), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_miss, __pyx_k_miss, sizeof(__pyx_k_miss), 0, 0, 1, 1},
  {&__pyx_n_s_miss_callback, __pyx_k_miss_callback, sizeof(__pyx_k_miss_callback), 0, 0, 1, 1},
  {&__pyx_n_s_miss_nothreads, __pyx_k_miss_nothreads, sizeof(__pyx_k_miss_nothreads), 0, 0, 1, 1},
  {&__pyx_n_s_mkf, __pyx_k_mkf, sizeof(__pyx_k_mkf), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_multiprocessing, __pyx_k_multiprocessing, sizeof(__pyx_k_multiprocessing), 0, 0, 1, 1},
  {&__pyx_n_s_multiprocessing_dummy, __pyx_k_multiprocessing_dummy, sizeof(__pyx_k_multiprocessing_dummy), 0, 0, 1, 1},
  {&__pyx_n_s_multiprocessing_pool, __pyx_k_multiprocessing_pool, sizeof(__pyx_k_multiprocessing_pool), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_n_s_nkeys, __pyx_k_nkeys, sizeof(__pyx_k_nkeys), 0, 0, 1, 1},
  {&__pyx_n_s_nkeys_append, __pyx_k_nkeys_append, sizeof(__pyx_k_nkeys_append), 0, 0, 1, 1},
  {&__pyx_n_s_norecurse, __pyx_k_norecurse, sizeof(__pyx_k_norecurse), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1},
  {&__pyx_n_s_on_any, __pyx_k_on_any, sizeof(__pyx_k_on_any), 0, 0, 1, 1},
  {&__pyx_n_s_on_any_once, __pyx_k_on_any_once, sizeof(__pyx_k_on_any_once), 0, 0, 1, 1},
  {&__pyx_n_s_on_done, __pyx_k_on_done, sizeof(__pyx_k_on_done), 0, 0, 1, 1},
  {&__pyx_n_s_on_exc, __pyx_k_on_exc, sizeof(__pyx_k_on_exc), 0, 0, 1, 1},
  {&__pyx_n_s_on_miss, __pyx_k_on_miss, sizeof(__pyx_k_on_miss), 0, 0, 1, 1},
  {&__pyx_n_s_on_stuff, __pyx_k_on_stuff, sizeof(__pyx_k_on_stuff), 0, 0, 1, 1},
  {&__pyx_n_s_on_task_cancelled, __pyx_k_on_task_cancelled, sizeof(__pyx_k_on_task_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_on_task_completed, __pyx_k_on_task_completed, sizeof(__pyx_k_on_task_completed), 0, 0, 1, 1},
  {&__pyx_n_s_on_task_queued, __pyx_k_on_task_queued, sizeof(__pyx_k_on_task_queued), 0, 0, 1, 1},
  {&__pyx_n_s_on_task_started, __pyx_k_on_task_started, sizeof(__pyx_k_on_task_started), 0, 0, 1, 1},
  {&__pyx_n_s_on_value, __pyx_k_on_value, sizeof(__pyx_k_on_value), 0, 0, 1, 1},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_overflow, __pyx_k_overflow, sizeof(__pyx_k_overflow), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1},
  {&__pyx_n_s_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_processor, __pyx_k_processor, sizeof(__pyx_k_processor), 0, 0, 1, 1},
  {&__pyx_n_s_promote, __pyx_k_promote, sizeof(__pyx_k_promote), 0, 0, 1, 1},
  {&__pyx_n_s_promote_callback, __pyx_k_promote_callback, sizeof(__pyx_k_promote_callback), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_purge, __pyx_k_purge, sizeof(__pyx_k_purge), 0, 0, 1, 1},
  {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1},
  {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_queue_future, __pyx_k_queue_future, sizeof(__pyx_k_queue_future), 0, 0, 1, 1},
  {&__pyx_n_s_queue_kwargs, __pyx_k_queue_kwargs, sizeof(__pyx_k_queue_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_queue_time, __pyx_k_queue_time, sizeof(__pyx_k_queue_time), 0, 0, 1, 1},
  {&__pyx_n_s_queue_ttl, __pyx_k_queue_ttl, sizeof(__pyx_k_queue_ttl), 0, 0, 1, 1},
  {&__pyx_n_s_queue_value, __pyx_k_queue_value, sizeof(__pyx_k_queue_value), 0, 0, 1, 1},
  {&__pyx_n_s_queuelen, __pyx_k_queuelen, sizeof(__pyx_k_queuelen), 0, 0, 1, 1},
  {&__pyx_n_s_queueset, __pyx_k_queueset, sizeof(__pyx_k_queueset), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_reentrant, __pyx_k_reentrant, sizeof(__pyx_k_reentrant), 0, 0, 1, 1},
  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
  {&__pyx_n_s_register_cleanup, __pyx_k_register_cleanup, sizeof(__pyx_k_register_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_register_default_cleanup, __pyx_k_register_default_cleanup, sizeof(__pyx_k_register_default_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_renew, __pyx_k_renew, sizeof(__pyx_k_renew), 0, 0, 1, 1},
  {&__pyx_n_s_renew_undefer, __pyx_k_renew_undefer, sizeof(__pyx_k_renew_undefer), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_reraise, __pyx_k_reraise, sizeof(__pyx_k_reraise), 0, 0, 1, 1},
  {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_running, __pyx_k_running, sizeof(__pyx_k_running), 0, 0, 1, 1},
  {&__pyx_n_s_running_2, __pyx_k_running_2, sizeof(__pyx_k_running_2), 0, 0, 1, 1},
  {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
  {&__pyx_kp_s_s_of_r, __pyx_k_s_of_r, sizeof(__pyx_k_s_of_r), 0, 0, 1, 0},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_serialize, __pyx_k_serialize, sizeof(__pyx_k_serialize), 0, 0, 1, 1},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
  {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1},
  {&__pyx_n_s_set_nothreads, __pyx_k_set_nothreads, sizeof(__pyx_k_set_nothreads), 0, 0, 1, 1},
  {&__pyx_n_s_set_result, __pyx_k_set_result, sizeof(__pyx_k_set_result), 0, 0, 1, 1},
  {&__pyx_n_s_set_running_or_notify_cancelled, __pyx_k_set_running_or_notify_cancelled, sizeof(__pyx_k_set_running_or_notify_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
  {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
  {&__pyx_n_s_spawning_lock, __pyx_k_spawning_lock, sizeof(__pyx_k_spawning_lock), 0, 0, 1, 1},
  {&__pyx_n_s_spawnlock, __pyx_k_spawnlock, sizeof(__pyx_k_spawnlock), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_start_time, __pyx_k_start_time, sizeof(__pyx_k_start_time), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_stats, __pyx_k_stats, sizeof(__pyx_k_stats), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_task, __pyx_k_task, sizeof(__pyx_k_task), 0, 0, 1, 1},
  {&__pyx_n_s_task_time, __pyx_k_task_time, sizeof(__pyx_k_task_time), 0, 0, 1, 1},
  {&__pyx_n_s_task_time_max, __pyx_k_task_time_max, sizeof(__pyx_k_task_time_max), 0, 0, 1, 1},
  {&__pyx_n_s_task_time_min, __pyx_k_task_time_min, sizeof(__pyx_k_task_time_min), 0, 0, 1, 1},
  {&__pyx_n_s_task_time_sum, __pyx_k_task_time_sum, sizeof(__pyx_k_task_time_sum), 0, 0, 1, 1},
  {&__pyx_n_s_taskqueue, __pyx_k_taskqueue, sizeof(__pyx_k_taskqueue), 0, 0, 1, 1},
  {&__pyx_n_s_tasks_cancelled, __pyx_k_tasks_cancelled, sizeof(__pyx_k_tasks_cancelled), 0, 0, 1, 1},
  {&__pyx_n_s_tasks_completed, __pyx_k_tasks_completed, sizeof(__pyx_k_tasks_completed), 0, 0, 1, 1},
  {&__pyx_n_s_tasks_queued, __pyx_k_tasks_queued, sizeof(__pyx_k_tasks_queued), 0, 0, 1, 1},
  {&__pyx_n_s_tasks_started, __pyx_k_tasks_started, sizeof(__pyx_k_tasks_started), 0, 0, 1, 1},
  {&__pyx_n_s_terminate, __pyx_k_terminate, sizeof(__pyx_k_terminate), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tfin, __pyx_k_tfin, sizeof(__pyx_k_tfin), 0, 0, 1, 1},
  {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 0, 0, 1, 1},
  {&__pyx_n_s_thread_id, __pyx_k_thread_id, sizeof(__pyx_k_thread_id), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_threadpool, __pyx_k_threadpool, sizeof(__pyx_k_threadpool), 0, 0, 1, 1},
  {&__pyx_n_s_threadpool_2, __pyx_k_threadpool_2, sizeof(__pyx_k_threadpool_2), 0, 0, 1, 1},
  {&__pyx_n_s_threadpool_factory, __pyx_k_threadpool_factory, sizeof(__pyx_k_threadpool_factory), 0, 0, 1, 1},
  {&__pyx_n_s_threadset, __pyx_k_threadset, sizeof(__pyx_k_threadset), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 0, 1, 1},
  {&__pyx_n_s_tidt, __pyx_k_tidt, sizeof(__pyx_k_tidt), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_time_time, __pyx_k_time_time, sizeof(__pyx_k_time_time), 0, 0, 1, 1},
  {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_tit_tat, __pyx_k_tit_tat, sizeof(__pyx_k_tit_tat), 0, 0, 1, 1},
  {&__pyx_n_s_tl, __pyx_k_tl, sizeof(__pyx_k_tl), 0, 0, 1, 1},
  {&__pyx_n_s_ttl, __pyx_k_ttl, sizeof(__pyx_k_ttl), 0, 0, 1, 1},
  {&__pyx_n_s_ttl_skip, __pyx_k_ttl_skip, sizeof(__pyx_k_ttl_skip), 0, 0, 1, 1},
  {&__pyx_n_s_tuple, __pyx_k_tuple, sizeof(__pyx_k_tuple), 0, 0, 1, 1},
  {&__pyx_n_s_undefer, __pyx_k_undefer, sizeof(__pyx_k_undefer), 0, 0, 1, 1},
  {&__pyx_n_s_usage, __pyx_k_usage, sizeof(__pyx_k_usage), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_value_2, __pyx_k_value_2, sizeof(__pyx_k_value_2), 0, 0, 1, 1},
  {&__pyx_n_s_value_callback, __pyx_k_value_callback, sizeof(__pyx_k_value_callback), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1},
  {&__pyx_n_s_viewkeys, __pyx_k_viewkeys, sizeof(__pyx_k_viewkeys), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_waction, __pyx_k_waction, sizeof(__pyx_k_waction), 0, 0, 1, 1},
  {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1},
  {&__pyx_n_s_wait_time, __pyx_k_wait_time, sizeof(__pyx_k_wait_time), 0, 0, 1, 1},
  {&__pyx_n_s_wait_time_max, __pyx_k_wait_time_max, sizeof(__pyx_k_wait_time_max), 0, 0, 1, 1},
  {&__pyx_n_s_wait_time_min, __pyx_k_wait_time_min, sizeof(__pyx_k_wait_time_min), 0, 0, 1, 1},
  {&__pyx_n_s_wait_time_sum, __pyx_k_wait_time_sum, sizeof(__pyx_k_wait_time_sum), 0, 0, 1, 1},
  {&__pyx_n_s_waitkey, __pyx_k_waitkey, sizeof(__pyx_k_waitkey), 0, 0, 1, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_weak_callback, __pyx_k_weak_callback, sizeof(__pyx_k_weak_callback), 0, 0, 1, 1},
  {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
  {&__pyx_n_s_weakref_2, __pyx_k_weakref_2, sizeof(__pyx_k_weakref_2), 0, 0, 1, 1},
  {&__pyx_n_s_wgetTtl, __pyx_k_wgetTtl, sizeof(__pyx_k_wgetTtl), 0, 0, 1, 1},
  {&__pyx_n_s_workers, __pyx_k_workers, sizeof(__pyx_k_workers), 0, 0, 1, 1},
  {&__pyx_n_s_working, __pyx_k_working, sizeof(__pyx_k_working), 0, 0, 1, 1},
  {&__pyx_n_s_working_future, __pyx_k_working_future, sizeof(__pyx_k_working_future), 0, 0, 1, 1},
  {&__pyx_n_s_workset, __pyx_k_workset, sizeof(__pyx_k_workset), 0, 0, 1, 1},
  {&__pyx_n_s_workset_get, __pyx_k_workset_get, sizeof(__pyx_k_workset_get), 0, 0, 1, 1},
  {&__pyx_n_s_wrapped, __pyx_k_wrapped, sizeof(__pyx_k_wrapped), 0, 0, 1, 1},
  {&__pyx_n_s_wrapped_action, __pyx_k_wrapped_action, sizeof(__pyx_k_wrapped_action), 0, 0, 1, 1},
  {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1},
  {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1},
  {&__pyx_n_s_writer_2, __pyx_k_writer_2, sizeof(__pyx_k_writer_2), 0, 0, 1, 1},
  {&__pyx_n_s_writer_queue_size, __pyx_k_writer_queue_size, sizeof(__pyx_k_writer_queue_size), 0, 0, 1, 1},
  {&__pyx_n_s_writer_threadpool, __pyx_k_writer_threadpool, sizeof(__pyx_k_writer_threadpool), 0, 0, 1, 1},
  {&__pyx_n_s_writer_threadpool_2, __pyx_k_writer_threadpool_2, sizeof(__pyx_k_writer_threadpool_2), 0, 0, 1, 1},
  {&__pyx_n_s_writer_threadpool_factory, __pyx_k_writer_threadpool_factory, sizeof(__pyx_k_writer_threadpool_factory), 0, 0, 1, 1},
  {&__pyx_n_s_writer_workers, __pyx_k_writer_workers, sizeof(__pyx_k_writer_workers), 0, 0, 1, 1},
  {&__pyx_n_s_wself, __pyx_k_wself, sizeof(__pyx_k_wself), 0, 0, 1, 1},
  {&__pyx_n_s_wself_2, __pyx_k_wself_2, sizeof(__pyx_k_wself_2), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 32, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 32, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 36, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 143, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 165, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 265, __pyx_L1_error)
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 332, __pyx_L1_error)
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 332, __pyx_L1_error)
  #endif
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 608, __pyx_L1_error)
  __pyx_builtin_vars = __Pyx_GetBuiltinName(__pyx_n_s_vars); if (!__pyx_builtin_vars) __PYX_ERR(0, 1233, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "chorde/clients/async.py":146
 *     def defer_threadpool(self):
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:             # <<<<<<<<<<<<<<
 *                 if self._defer_threadpool is None:
 *                     if self._defer_threadpool_factory is not None:
 */
  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "chorde/clients/async.py":206
 *                     value = _NONE
 *                 except:
 *                     self.logger.error("Error in background cache refresh", exc_info=True)             # <<<<<<<<<<<<<<
 *                     value = _NONE
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Error_in_background_cache_refres); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "chorde/clients/async.py":219
 *                     self.client.delete(key)
 *                 except:
 *                     self.logger.error("Error deleting key", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _RENEW:
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Error_deleting_key); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "chorde/clients/async.py":225
 *                     self.client.renew(key, ttl, **(kw or {}))
 *                 except:
 *                     self.logger.error("Error renewing key", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _EXPIRE:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Error_renewing_key); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "chorde/clients/async.py":231
 *                     self.client.expire(key)
 *                 except:
 *                     self.logger.error("Error expiring key", exc_info=True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _CLEAR:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Error_expiring_key); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "chorde/clients/async.py":237
 *                     self.client.clear()
 *                 except:
 *                     self.logger.error("Error clearing cache", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *             elif value is _PURGE:
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Error_clearing_cache); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "chorde/clients/async.py":243
 *                     self.client.purge()
 *                 except:
 *                     self.logger.error("Error purging cache", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Error_purging_cache); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "chorde/clients/async.py":284
 *                     task()
 *         except:
 *             self.logger.error("Error during cleanup", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Error_during_cleanup); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "chorde/clients/async.py":928
 *                         else:
 *                             error = logging.error
 *                         error("Error in async callback", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *         def set(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Error_in_async_callback); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "chorde/clients/async.py":1002
 *             will be invoked with its result.
 *             """
 *             def value_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is not CacheMissError and not isinstance(value, ExceptionWrapper):
 *                     return callback(value)
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);
  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_value_callback, 1002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1002, __pyx_L1_error)

  /* "chorde/clients/async.py":1012
 *             without arugments.
 *             """
 *             def miss_callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     return callback()
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_miss_callback, 1012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 1012, __pyx_L1_error)

  /* "chorde/clients/async.py":1022
 *             with an exc_info tuple as returned by sys.exc_info.
 *             """
 *             def exc_callback(value):             # <<<<<<<<<<<<<<
 *                 if isinstance(value, ExceptionWrapper):
 *                     return callback(value.value)
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_exc_callback, 1022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1022, __pyx_L1_error)

  /* "chorde/clients/async.py":1032
 *             faster than calling on_X repeatedly. None callbacks will be ignored.
 *             """
 *             def callback(value):             # <<<<<<<<<<<<<<
 *                 if value is CacheMissError:
 *                     if on_miss is not None:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_callback, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1032, __pyx_L1_error)

  /* "chorde/clients/async.py":1056
 *             regardless of the outcome. If the operation is cancelled, it won't be invoked.
 *             """
 *             def done_callback(value):             # <<<<<<<<<<<<<<
 *                 return callback()
 *             return self._on_stuff(done_callback)
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_done_callback, 1056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1056, __pyx_L1_error)

  /* "chorde/clients/async.py":1095
 *             """
 *             me = weakref.ref(self)
 *             def weak_callback(value):             # <<<<<<<<<<<<<<
 *                 self = me()
 *                 if self is not None:
 */
  __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_self); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_weak_callback, 1095, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1095, __pyx_L1_error)

  /* "chorde/clients/async.py":1186
 *                     for timeout in (0, timeout):
 *                         if event.wait(timeout) and not norecurse:
 *                             return self.result(0, norecurse=True)             # <<<<<<<<<<<<<<
 *                         elif self.cancelled():
 *                             raise CancelledError
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "chorde/clients/async.py":1237
 *                 def mkf(name, fn):
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):             # <<<<<<<<<<<<<<
 *                         return getattr(self.__wrapped, name)(*p, **kw)
 *                     return f
 */
  __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_p, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_f, 1237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 1237, __pyx_L1_error)

  /* "chorde/clients/async.py":1230
 *     """
 *     class WrapperFuture(base):
 *         def __init__(self, wrapped):             # <<<<<<<<<<<<<<
 *             self.__wrapped = wrapped
 * 
 */
  __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_wrapped); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 1230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 1230, __pyx_L1_error)

  /* "chorde/clients/async.py":1235
 *         for name, fn in vars(base).iteritems():
 *             if not name.startswith('__') and callable(fn):
 *                 def mkf(name, fn):             # <<<<<<<<<<<<<<
 *                     @functools.wraps(fn)
 *                     def f(self, *p, **kw):
 */
  __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_name_2, __pyx_n_s_fn, __pyx_n_s_f, __pyx_n_s_f); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_mkf, 1235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1235, __pyx_L1_error)

  /* "chorde/clients/async.py":1350
 *         self.cleanup_cycles = cleanup_cycles
 * 
 *         self._tit_tat = itertools.cycle(iter((True,False))).next             # <<<<<<<<<<<<<<
 * 
 *         self.stats = ProcessorStats()
 */
  __pyx_tuple__32 = PyTuple_Pack(2, Py_True, Py_False); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "chorde/clients/async.py":1420
 *                                         task()
 *                             except:
 *                                 logger.error("Error during background thread cleanup", exc_info = True)             # <<<<<<<<<<<<<<
 * 
 *                     # discard queue head quickly when we're overloaded
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Error_during_background_thread_c); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "chorde/clients/async.py":1399
 *                 queue_time = time.time()
 *                 def wrapped_action():
 *                     def clean_coalesce():             # <<<<<<<<<<<<<<
 *                         if do_coalescence:
 *                             try:
 */
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clean_coalesce, 1399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 1399, __pyx_L1_error)

  /* "chorde/clients/async.py":1406
 *                                 pass
 * 
 *                     def clean(self):             # <<<<<<<<<<<<<<
 *                         if self is not None:
 *                             try:
 */
  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tl, __pyx_n_s_task); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clean, 1406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1406, __pyx_L1_error)

  /* "chorde/clients/async.py":1451
 *                                 cleaned_coalesce = True
 *                                 # Clear up traceback to avoid leaks
 *                                 cfuture.exc(sys.exc_info()[:-1] + (None,))             # <<<<<<<<<<<<<<
 *                             stats.on_task_completed(time.time() - start_time)
 *                         else:
 */
  __pyx_slice__37 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__37);
  __Pyx_GIVEREF(__pyx_slice__37);
  __pyx_tuple__38 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "chorde/clients/async.py":1398
 *                 stats = self.stats
 *                 queue_time = time.time()
 *                 def wrapped_action():             # <<<<<<<<<<<<<<
 *                     def clean_coalesce():
 *                         if do_coalescence:
 */
  __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_clean_coalesce, __pyx_n_s_clean_coalesce, __pyx_n_s_clean, __pyx_n_s_clean, __pyx_n_s_self, __pyx_n_s_cleaned_coalesce, __pyx_n_s_start_time, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_wrapped_action, 1398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1398, __pyx_L1_error)

  /* "chorde/clients/async.py":31
 * class REGET:pass
 * 
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])             # <<<<<<<<<<<<<<
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_promote_callback); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "chorde/clients/async.py":33
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):             # <<<<<<<<<<<<<<
 *     return id(value) in SPECIAL
 * 
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_is_special, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 33, __pyx_L1_error)

  /* "chorde/clients/async.py":36
 *     return id(value) in SPECIAL
 * 
 * class Defer(object):             # <<<<<<<<<<<<<<
 *     """
 *     Wrap a callable in this, and pass it as a value to an AsyncWriteCacheClient,
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "chorde/clients/async.py":50
 *     """
 * 
 *     def __init__(self, callable_, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.callable_ = callable_
 *         self.args = args
 */
  __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callable, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 50, __pyx_L1_error)

  /* "chorde/clients/async.py":56
 *         self.lazy = False
 * 
 *     def undefer(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 */
  __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_getattr, __pyx_n_s_future, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_undefer, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 56, __pyx_L1_error)

  /* "chorde/clients/async.py":73
 *             return _NONE
 * 
 *     def set(self, value):             # <<<<<<<<<<<<<<
 *         self.rv = value
 * 
 */
  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_set, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 73, __pyx_L1_error)

  /* "chorde/clients/async.py":76
 *         self.rv = value
 * 
 *     def done(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():
 */
  __pyx_tuple__51 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_getattr, __pyx_n_s_future, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_done, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 76, __pyx_L1_error)

  /* "chorde/clients/async.py":85
 *                 future.set(rv)
 * 
 * def _renew_undefer(self, key, ttl, kw, value):             # <<<<<<<<<<<<<<
 *     self = self()
 *     self.client.renew(key, ttl, **(kw or {}))
 */
  __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ttl, __pyx_n_s_kw, __pyx_n_s_value); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_renew_undefer, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 85, __pyx_L1_error)

  /* "chorde/clients/async.py":97
 *     Process = AsyncCacheWriterThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */
  __pyx_tuple__55 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_workers, __pyx_n_s_current); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 97, __pyx_L1_error)

  /* "chorde/clients/async.py":108
 * 
 * class AsyncCacheWriterPool:
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 * 
 */
  __pyx_tuple__57 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_workers, __pyx_n_s_client, __pyx_n_s_overflow, __pyx_n_s_cleanup_cycles, __pyx_n_s_defer_threadpool, __pyx_n_s_writer_threadpool); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 108, __pyx_L1_error)
  __pyx_tuple__59 = PyTuple_Pack(4, ((PyObject *)Py_False), ((PyObject *)__pyx_int_500), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "chorde/clients/async.py":144
 * 
 *     @property
 *     def defer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_defer_threadpool, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 144, __pyx_L1_error)

  /* "chorde/clients/async.py":155
 * 
 *     @property
 *     def writer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_writer_threadpool, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 155, __pyx_L1_error)

  /* "chorde/clients/async.py":166
 * 
 *     @staticmethod
 *     def _writer(self, key, reentrant = True):             # <<<<<<<<<<<<<<
 *         # self is weakref
 *         self = self()
 */
  __pyx_tuple__64 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_reentrant, __pyx_n_s_thread_id, __pyx_n_s_ev, __pyx_n_s_deferred, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw, __pyx_n_s_w, __pyx_n_s_kev, __pyx_n_s_task); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_writer, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 166, __pyx_L1_error)
  __pyx_tuple__66 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "chorde/clients/async.py":287
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_capacity, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 287, __pyx_L1_error)

  /* "chorde/clients/async.py":291
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return len(self.queueset)
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_usage, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 291, __pyx_L1_error)

  /* "chorde/clients/async.py":295
 * 
 *     @serialize
 *     def dequeue(self, key):             # <<<<<<<<<<<<<<
 *         rv = self.queueset.pop(key, _NONE)
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()
 */
  __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_dequeue, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 295, __pyx_L1_error)

  /* "chorde/clients/async.py":301
 * 
 *     @serialize
 *     def drop_one(self):             # <<<<<<<<<<<<<<
 *         for key in self.queueset:
 *             break
 */
  __pyx_tuple__73 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_drop_one, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 301, __pyx_L1_error)

  /* "chorde/clients/async.py":309
 *         return rv
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):             # <<<<<<<<<<<<<<
 *         if (thread.get_ident() in self.threadset
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 */
  __pyx_tuple__76 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw, __pyx_n_s_queueset, __pyx_n_s_delayed, __pyx_n_s__75, __pyx_n_s_ev); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_enqueue_2, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 309, __pyx_L1_error)
  __pyx_tuple__78 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "chorde/clients/async.py":349
 * 
 *     @serialize
 *     def clearqueue(self):             # <<<<<<<<<<<<<<
 *         delayed = []
 *         for entry in self.queueset.itervalues():
 */
  __pyx_tuple__79 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_delayed, __pyx_n_s_entry, __pyx_n_s_value, __pyx_n_s_future); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clearqueue, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 349, __pyx_L1_error)

  /* "chorde/clients/async.py":360
 *         return delayed
 * 
 *     def _coalesce(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */
  __pyx_tuple__81 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw, __pyx_n_s_delayed, __pyx_n_s_queueset, __pyx_n_s_future, __pyx_n_s_queue_value, __pyx_n_s_queue_future, __pyx_n_s_queue_ttl, __pyx_n_s_queue_kwargs); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_coalesce, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 360, __pyx_L1_error)

  /* "chorde/clients/async.py":406
 * 
 *     @serialize
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */
  __pyx_tuple__83 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_isinstance, __pyx_n_s_getattr, __pyx_n_s_hasattr, __pyx_n_s_kw, __pyx_n_s_delayed, __pyx_n_s_queueset, __pyx_n_s_workset, __pyx_n_s_threadpool, __pyx_n_s_reentrant, __pyx_n_s_future, __pyx_n_s_working, __pyx_n_s_working_future); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(7, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_enqueue, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 406, __pyx_L1_error)

  /* "chorde/clients/async.py":451
 *         return delayed
 * 
 *     def waitkey(self, key, timeout=None):             # <<<<<<<<<<<<<<
 *         tid = thread.get_ident()
 *         if (tid in self.threadset
 */
  __pyx_tuple__85 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_timeout, __pyx_n_s_tid, __pyx_n_s_tidt, __pyx_n_s_queueset, __pyx_n_s_workset_get, __pyx_n_s_done_event, __pyx_n_s_sleep, __pyx_n_s_busyloop, __pyx_n_s_ev, __pyx_n_s_done, __pyx_n_s_time_time, __pyx_n_s_tfin); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_waitkey, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 451, __pyx_L1_error)
  __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "chorde/clients/async.py":513
 *                 timeout = tfin - time_time()
 * 
 *     def getTtl(self, key, default = None):             # <<<<<<<<<<<<<<
 *         # Speeding up things - we have the same signature and semantics
 *         self.getTtl = getTtl = self.queueset.get
 */
  __pyx_tuple__88 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_getTtl); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_getTtl, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 513, __pyx_L1_error)
  __pyx_tuple__90 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "chorde/clients/async.py":518
 *         return getTtl(key, default)
 * 
 *     def contains(self, key):             # <<<<<<<<<<<<<<
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:
 */
  __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_tid); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_contains_3, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 518, __pyx_L1_error)

  /* "chorde/clients/async.py":528
 *             return self.workset.get(key, (tid,))[0] != tid
 * 
 *     def _contains(self, key):             # <<<<<<<<<<<<<<
 *         # Fast version of contains that doesn't check the workset
 *         # Useful for special-purpose checks, like contains(CLEAR)
 */
  __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_contains_2); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_contains_2, 528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 528, __pyx_L1_error)

  /* "chorde/clients/async.py":534
 *         return _contains(key)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, value, ttl, **kw)
 * 
 */
  __pyx_tuple__95 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_put, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 534, __pyx_L1_error)

  /* "chorde/clients/async.py":537
 *         self.enqueue(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         # Don't schedule a renew if another thing is queued on the key
 *         # It causes... issues
 */
  __pyx_tuple__97 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_renew, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 537, __pyx_L1_error)

  /* "chorde/clients/async.py":543
 *             self.enqueue(key, _RENEW, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _DELETE)
 * 
 */
  __pyx_tuple__99 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_delete, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 543, __pyx_L1_error)

  /* "chorde/clients/async.py":546
 *         self.enqueue(key, _DELETE)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _EXPIRE)
 * 
 */
  __pyx_tuple__101 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_expire, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 546, __pyx_L1_error)

  /* "chorde/clients/async.py":549
 *         self.enqueue(key, _EXPIRE)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)
 */
  __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_delayed); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clear, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 549, __pyx_L1_error)

  /* "chorde/clients/async.py":558
 *                 pass
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         self.enqueue(_PURGE, _PURGE)
 * 
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_purge, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 558, __pyx_L1_error)

  /* "chorde/clients/async.py":561
 *         self.enqueue(_PURGE, _PURGE)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_task); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_cleanup, 561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 561, __pyx_L1_error)

  /* "chorde/clients/async.py":570
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_task); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_default_cleanup, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 570, __pyx_L1_error)

  /* "chorde/clients/async.py":580
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client
 */
  __pyx_tuple__111 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_client, __pyx_n_s_writer_queue_size, __pyx_n_s_writer_workers, __pyx_n_s_overflow, __pyx_n_s_threadpool, __pyx_n_s_defer_threadpool, __pyx_n_s_writer_threadpool); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 580, __pyx_L1_error)
  __pyx_tuple__113 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "chorde/clients/async.py":591
 *         self._writer_threadpool = writer_threadpool or threadpool
 * 
 *     def assert_started(self):             # <<<<<<<<<<<<<<
 *         if self.writer is None:
 *             with self.spawning_lock:
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_assert_started, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 591, __pyx_L1_error)

  /* "chorde/clients/async.py":603
 *                         writer_threadpool = self._writer_threadpool)
 * 
 *     def is_started(self):             # <<<<<<<<<<<<<<
 *         return self.writer is not None
 * 
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_is_started, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 603, __pyx_L1_error)

  /* "chorde/clients/async.py":606
 *         return self.writer is not None
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_start, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 606, __pyx_L1_error)

  /* "chorde/clients/async.py":611
 *         self.assert_started()
 * 
 *     def stop(self, abort_tasks=False):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             if not abort_tasks:
 */
  __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_abort_tasks); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_stop, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 611, __pyx_L1_error)
  __pyx_tuple__122 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "chorde/clients/async.py":618
 * 
 *     @property
 *     def async(self):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_async, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 618, __pyx_L1_error)

  /* "chorde/clients/async.py":622
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)
 * 
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_capacity, 622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 622, __pyx_L1_error)

  /* "chorde/clients/async.py":626
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_usage, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 626, __pyx_L1_error)

  /* "chorde/clients/async.py":629
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.put(key, value, ttl, **kw)
 */
  __pyx_tuple__129 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_put, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 629, __pyx_L1_error)

  /* "chorde/clients/async.py":633
 *         self.writer.put(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.renew(key, ttl, **kw)
 */
  __pyx_tuple__131 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_renew, 633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 633, __pyx_L1_error)

  /* "chorde/clients/async.py":637
 *         self.writer.renew(key, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.delete(key)
 */
  __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_delete, 637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 637, __pyx_L1_error)

  /* "chorde/clients/async.py":641
 *         self.writer.delete(key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.expire(key)
 */
  __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_expire, 641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 641, __pyx_L1_error)

  /* "chorde/clients/async.py":645
 *         self.writer.expire(key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             self.writer.clear()
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clear, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 645, __pyx_L1_error)

  /* "chorde/clients/async.py":649
 *             self.writer.clear()
 * 
 *     def purge(self, timeout = None):             # <<<<<<<<<<<<<<
 *         """
 *         Timeout is ignored
 */
  __pyx_tuple__139 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_purge, 649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 649, __pyx_L1_error)
  __pyx_tuple__141 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "chorde/clients/async.py":656
 *             self.writer.purge()
 * 
 *     def getTtl(self, key, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_tuple__142 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_DELETE, __pyx_n_s_EXPIRE, __pyx_n_s_RENEW, __pyx_n_s_CLEAR, __pyx_n_s_NONE_2, __pyx_n_s_NONE, __pyx_n_s_hasattr, __pyx_n_s_kw, __pyx_n_s_ettl, __pyx_n_s_writer_2, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s__75); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(10, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_getTtl, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 656, __pyx_L1_error)

  /* "chorde/clients/async.py":702
 *             return value, ttl
 * 
 *     def get(self, key, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_tuple__144 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_ttl_skip, __pyx_n_s_DELETE, __pyx_n_s_EXPIRE, __pyx_n_s_RENEW, __pyx_n_s_CLEAR, __pyx_n_s_NONE_2, __pyx_n_s_NONE, __pyx_n_s_hasattr, __pyx_n_s_kw, __pyx_n_s_writer_2, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s__75); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(11, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_get, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 702, __pyx_L1_error)

  /* "chorde/clients/async.py":739
 *         return self.client.get(key, default, ttl_skip = ttl_skip, **kw)
 * 
 *     def getTtlMulti(self, keys, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_tuple__146 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_keys, __pyx_n_s_default, __pyx_n_s_DELETE, __pyx_n_s_EXPIRE, __pyx_n_s_RENEW, __pyx_n_s_CLEAR, __pyx_n_s_NONE_2, __pyx_n_s_NONE, __pyx_n_s_hasattr, __pyx_n_s_kw, __pyx_n_s_ettl, __pyx_n_s_writer_2, __pyx_n_s_default_rv, __pyx_n_s_wgetTtl, __pyx_n_s_nkeys, __pyx_n_s_nkeys_append, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s__75, __pyx_n_s_ettlget); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(10, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_getTtlMulti, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 739, __pyx_L1_error)

  /* "chorde/clients/async.py":787
 *             yield key, (value, ttl)
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_tuple__147 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_keys, __pyx_n_s_default, __pyx_n_s_ttl_skip, __pyx_n_s_DELETE, __pyx_n_s_EXPIRE, __pyx_n_s_RENEW, __pyx_n_s_CLEAR, __pyx_n_s_NONE_2, __pyx_n_s_NONE, __pyx_n_s_hasattr, __pyx_n_s_kw, __pyx_n_s_ettl, __pyx_n_s_ettl_append, __pyx_n_s_writer_2, __pyx_n_s_wgetTtl, __pyx_n_s_nkeys, __pyx_n_s_nkeys_append, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s__75); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(11, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_getMulti, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 787, __pyx_L1_error)

  /* "chorde/clients/async.py":839
 *                 yield key, value
 * 
 *     def promote(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             return
 */
  __pyx_tuple__148 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_p, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_promote, 839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 839, __pyx_L1_error)

  /* "chorde/clients/async.py":845
 *             return self.client.promote(key, *p, **kw)
 * 
 *     def wait(self, key, timeout = None):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             self.writer.waitkey(key, timeout)
 */
  __pyx_tuple__150 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);
  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_wait, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 845, __pyx_L1_error)
  __pyx_tuple__152 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "chorde/clients/async.py":849
 *             self.writer.waitkey(key, timeout)
 * 
 *     def contains(self, key, ttl = None, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             if self.writer.contains(key):
 */
  __pyx_tuple__153 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_contains_3, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 849, __pyx_L1_error)
  __pyx_tuple__155 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "chorde/clients/async.py":859
 * 
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_tuple__156 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_task); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_cleanup, 859, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 859, __pyx_L1_error)

  /* "chorde/clients/async.py":867
 *         self.writer.register_cleanup(task)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 */
  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_str, 867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 867, __pyx_L1_error)

  /* "chorde/clients/async.py":870
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self)
 * 
 */
  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_repr, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 870, __pyx_L1_error)

  /* "chorde/clients/async.py":877
 * except ImportError:
 *     import warnings
 *     warnings.warn("_async extension module not built in, "             # <<<<<<<<<<<<<<
 *         "using pure-python version which is not atomic and requires"
 *         "explicit synchronization. Decreased performance will be noticeable")
 */
  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_async_extension_module_not_buil); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "chorde/clients/async.py":882
 *     del warnings
 * 
 *     class ExceptionWrapper(object):  # lint:ok             # <<<<<<<<<<<<<<
 *         __slots__ = ('value',)
 * 
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "chorde/clients/async.py":883
 * 
 *     class ExceptionWrapper(object):  # lint:ok
 *         __slots__ = ('value',)             # <<<<<<<<<<<<<<
 * 
 *         def __init__(self, value):
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "chorde/clients/async.py":885
 *         __slots__ = ('value',)
 * 
 *         def __init__(self, value):             # <<<<<<<<<<<<<<
 *             self.value = value
 * 
 */
  __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 885, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 885, __pyx_L1_error)

  /* "chorde/clients/async.py":888
 *             self.value = value
 * 
 *         def reraise(self):             # <<<<<<<<<<<<<<
 *             exc = self.value
 *             del self.value
 */
  __pyx_tuple__167 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_reraise, 888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 888, __pyx_L1_error)

  /* "chorde/clients/async.py":893
 *             raise exc[0], exc[1], exc[2]
 * 
 *     class Future(object):  # lint:ok             # <<<<<<<<<<<<<<
 *         __slots__ = (
 *             '_cb', '_value', '_logger', '_running', '_cancel_pending', '_cancelled', '_done_event',
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "chorde/clients/async.py":895
 *     class Future(object):  # lint:ok
 *         __slots__ = (
 *             '_cb', '_value', '_logger', '_running', '_cancel_pending', '_cancelled', '_done_event',             # <<<<<<<<<<<<<<
 *             '_lock', '__weakref__',
 *         )
 */
  __pyx_tuple__170 = PyTuple_Pack(9, __pyx_n_s_cb, __pyx_n_s_value_2, __pyx_n_s_logger_2, __pyx_n_s_running, __pyx_n_s_cancel_pending, __pyx_n_s_cancelled, __pyx_n_s_done_event_2, __pyx_n_s_lock, __pyx_n_s_weakref_2); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "chorde/clients/async.py":899
 *         )
 * 
 *         def __init__(self, logger = None):             # <<<<<<<<<<<<<<
 *             self._cb = []
 *             self._logger = logger
 */
  __pyx_tuple__171 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_logger); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 899, __pyx_L1_error)
  __pyx_tuple__173 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "chorde/clients/async.py":904
 *             self._lock = threading.Lock()
 * 
 *         def _set_nothreads(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Like set(), but assuming no threading is involved. It won't wake waiting threads,
 */
  __pyx_tuple__174 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_hasattr, __pyx_n_s_tuple, __pyx_n_s_getattr, __pyx_n_s_cbs, __pyx_n_s_cb_2, __pyx_n_s_error); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_set_nothreads, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 904, __pyx_L1_error)

  /* "chorde/clients/async.py":930
 *                         error("Error in async callback", exc_info = True)
 * 
 *         def set(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Set the future's result as either a value, an exception wrappedn in ExceptionWrapper, or
 */
  __pyx_tuple__176 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_hasattr, __pyx_n_s_tuple, __pyx_n_s_getattr, __pyx_n_s_old, __pyx_n_s_cbs, __pyx_n_s_cb_2, __pyx_n_s_error, __pyx_n_s_event); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_set, 930, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 930, __pyx_L1_error)

  /* "chorde/clients/async.py":963
 *         set_result = set
 * 
 *         def miss(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_miss, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 963, __pyx_L1_error)

  /* "chorde/clients/async.py":969
 *             self.set(CacheMissError)
 * 
 *         def _miss_nothreads(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result without thread safety.
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_miss_nothreads, 969, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 969, __pyx_L1_error)

  /* "chorde/clients/async.py":976
 *             self._set_nothreads(CacheMissError)
 * 
 *         def exc(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */
  __pyx_tuple__182 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_exc, 976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 976, __pyx_L1_error)

  /* "chorde/clients/async.py":983
 *             self.set(ExceptionWrapper(exc_info))
 * 
 *         def _exc_nothreads(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */
  __pyx_tuple__184 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_exc_nothreads, 983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 983, __pyx_L1_error)

  /* "chorde/clients/async.py":991
 *             self._set_nothreads(ExceptionWrapper(exc_info))
 * 
 *         def set_exception(self, exception):             # <<<<<<<<<<<<<<
 *             """
 *             Set the Future's exception object.
 */
  __pyx_tuple__186 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exception); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_set_exception, 991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 991, __pyx_L1_error)

  /* "chorde/clients/async.py":997
 *             self.exc((type(exception),exception,None))
 * 
 *         def on_value(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When and if the operation completes without exception, the callback
 */
  __pyx_tuple__188 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_value_callback, __pyx_n_s_value_callback); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);
  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_value, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 997, __pyx_L1_error)

  /* "chorde/clients/async.py":1007
 *             return self._on_stuff(value_callback)
 * 
 *         def on_miss(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in a cache miss, the callback will be invoked
 */
  __pyx_tuple__190 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_miss_callback, __pyx_n_s_miss_callback); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);
  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_miss, 1007, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 1007, __pyx_L1_error)

  /* "chorde/clients/async.py":1017
 *             return self._on_stuff(miss_callback)
 * 
 *         def on_exc(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in an exception, the callback will be invoked
 */
  __pyx_tuple__192 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_exc_callback, __pyx_n_s_exc_callback); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);
  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_exc, 1017, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 1017, __pyx_L1_error)

  /* "chorde/clients/async.py":1027
 *             return self._on_stuff(exc_callback)
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Handy method to set callbacks for all kinds of results, and it's actually
 */
  __pyx_tuple__194 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_on_value, __pyx_n_s_on_miss, __pyx_n_s_on_exc, __pyx_n_s_callback, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);
  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_any, 1027, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __pyx_tuple__196 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "chorde/clients/async.py":1044
 *             return self._on_stuff(callback)
 * 
 *         def on_any_once(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Like on_any, but will only set the callback if no other callback has been set
 */
  __pyx_tuple__197 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_on_value, __pyx_n_s_on_miss, __pyx_n_s_on_exc); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_any_once, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 1044, __pyx_L1_error)
  __pyx_tuple__199 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "chorde/clients/async.py":1051
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 *         def on_done(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operation is done, the callback will be invoked without arguments,
 */
  __pyx_tuple__200 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_done_callback, __pyx_n_s_done_callback); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_done, 1051, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 1051, __pyx_L1_error)

  /* "chorde/clients/async.py":1060
 *             return self._on_stuff(done_callback)
 * 
 *         def chain(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer
 */
  __pyx_tuple__202 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_defer); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_chain, 1060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1060, __pyx_L1_error)

  /* "chorde/clients/async.py":1066
 *             self._on_stuff(defer.set)
 * 
 *         def chain_std(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer, without assuming the other
 */
  __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_defer); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_chain_std, 1066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1066, __pyx_L1_error)

  /* "chorde/clients/async.py":1077
 *             )
 * 
 *         def _on_stuff(self, callback, hasattr=hasattr):             # <<<<<<<<<<<<<<
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')
 */
  __pyx_tuple__206 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_hasattr, __pyx_n_s_cbap, __pyx_n_s_docall); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_stuff, 1077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1077, __pyx_L1_error)

  /* "chorde/clients/async.py":1089
 *             return self
 * 
 *         def add_done_callback(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operatio is done, the callback will be invoked with the
 */
  __pyx_tuple__208 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_me, __pyx_n_s_weak_callback, __pyx_n_s_weak_callback); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_add_done_callback, 1089, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 1089, __pyx_L1_error)

  /* "chorde/clients/async.py":1101
 *             return self._on_stuff(weak_callback)
 * 
 *         def done(self, hasattr=hasattr, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has finished, in a result or exception or cancelled, and False if not.
 */
  __pyx_tuple__210 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_hasattr, __pyx_n_s_getattr); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_done, 1101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 1101, __pyx_L1_error)

  /* "chorde/clients/async.py":1107
 *             return hasattr(self, '_value') or getattr(self, '_cancelled', False)
 * 
 *         def running(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation is running and cannot be cancelled. False if not running
 */
  __pyx_tuple__212 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_getattr); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_running_2, 1107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1107, __pyx_L1_error)

  /* "chorde/clients/async.py":1114
 *             return getattr(self, '_running', False)
 * 
 *         def cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has been cancelled successfully.
 */
  __pyx_tuple__214 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_getattr); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_cancelled_2, 1114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1114, __pyx_L1_error)

  /* "chorde/clients/async.py":1120
 *             return getattr(self, '_cancelled', False)
 * 
 *         def cancel_pending(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if cancel was called.
 */
  __pyx_tuple__216 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_getattr); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_cancel_pending_2, 1120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1120, __pyx_L1_error)

  /* "chorde/clients/async.py":1126
 *             return getattr(self, '_cancel_pending', False)
 * 
 *         def cancel(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Request cancelling of the operation. If the operation cannot be cancelled,
 */
  __pyx_tuple__218 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_getattr); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_cancel, 1126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1126, __pyx_L1_error)

  /* "chorde/clients/async.py":1137
 *                 return True
 * 
 *         def set_running_or_notify_cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             To be invoked by executors before executing the operation. If it returns True,
 */
  __pyx_tuple__220 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_getattr); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_set_running_or_notify_cancelled, 1137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1137, __pyx_L1_error)

  /* "chorde/clients/async.py":1156
 *                 return True
 * 
 *         def result(self, timeout=None, hasattr=hasattr, getattr=getattr, isinstance=isinstance, norecurse=False):             # <<<<<<<<<<<<<<
 *             """
 *             Return the operation's result, if any. If an exception was the result, re-raise it.
 */
  __pyx_tuple__222 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_timeout, __pyx_n_s_hasattr, __pyx_n_s_getattr, __pyx_n_s_isinstance, __pyx_n_s_norecurse, __pyx_n_s_value, __pyx_n_s_event); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(6, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_result, 1156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1156, __pyx_L1_error)

  /* "chorde/clients/async.py":1195
 *                         raise TimeoutError
 * 
 *         def exception(self, timeout=None):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation resulted in an exception, return the exception object.
 */
  __pyx_tuple__224 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_timeout, __pyx_n_s_value, __pyx_n_s_e); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_exception, 1195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __pyx_tuple__226 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);

  /* "chorde/clients/async.py":1222
 * 
 * 
 * def makeFutureWrapper(base):             # <<<<<<<<<<<<<<
 *     """
 *     Nice utility function to create Future wrappers. If using a library
 */
  __pyx_tuple__227 = PyTuple_Pack(2, __pyx_n_s_base, __pyx_n_s_WrapperFuture); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_makeFutureWrapper, 1222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 1222, __pyx_L1_error)

  /* "chorde/clients/async.py":1249
 *     Process = AsyncCacheProcessorThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */
  __pyx_tuple__229 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_workers, __pyx_n_s_current); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 1249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 1249, __pyx_L1_error)

  /* "chorde/clients/async.py":1258
 *         ThreadPool.__init__(self, workers)
 * 
 * class ProcessorStats(object):             # <<<<<<<<<<<<<<
 *     __slots__ = (
 *         'tasks_queued',
 */
  __pyx_tuple__231 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);

  /* "chorde/clients/async.py":1260
 * class ProcessorStats(object):
 *     __slots__ = (
 *         'tasks_queued',             # <<<<<<<<<<<<<<
 *         'tasks_started',
 *         'tasks_cancelled',
 */
  __pyx_tuple__232 = PyTuple_Pack(10, __pyx_n_s_tasks_queued, __pyx_n_s_tasks_started, __pyx_n_s_tasks_cancelled, __pyx_n_s_tasks_completed, __pyx_n_s_wait_time_sum, __pyx_n_s_wait_time_min, __pyx_n_s_wait_time_max, __pyx_n_s_task_time_sum, __pyx_n_s_task_time_min, __pyx_n_s_task_time_max); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);

  /* "chorde/clients/async.py":1271
 *         'task_time_max',
 *     )
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */
  __pyx_tuple__233 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 1271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 1271, __pyx_L1_error)

  /* "chorde/clients/async.py":1274
 *         self.reset()
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0
 *         self.wait_time_sum = self.task_time_sum = 0
 */
  __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_reset, 1274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 1274, __pyx_L1_error)

  /* "chorde/clients/async.py":1279
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None
 * 
 *     def on_task_queued(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued += 1
 * 
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_task_queued, 1279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 1279, __pyx_L1_error)

  /* "chorde/clients/async.py":1282
 *         self.tasks_queued += 1
 * 
 *     def on_task_cancelled(self):             # <<<<<<<<<<<<<<
 *         self.tasks_cancelled += 1
 * 
 */
  __pyx_tuple__239 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_task_cancelled, 1282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 1282, __pyx_L1_error)

  /* "chorde/clients/async.py":1285
 *         self.tasks_cancelled += 1
 * 
 *     def on_task_started(self, wait_time):             # <<<<<<<<<<<<<<
 *         self.tasks_started += 1
 *         self.wait_time_sum += wait_time
 */
  __pyx_tuple__241 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_wait_time, __pyx_n_s_wait_time_min, __pyx_n_s_wait_time_max); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_task_started, 1285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 1285, __pyx_L1_error)

  /* "chorde/clients/async.py":1295
 *             self.wait_time_max = wait_time
 * 
 *     def on_task_completed(self, task_time):             # <<<<<<<<<<<<<<
 *         self.tasks_completed += 1
 *         self.task_time_sum += task_time
 */
  __pyx_tuple__243 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_task_time, __pyx_n_s_task_time_min, __pyx_n_s_task_time_max); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_on_task_completed, 1295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 1295, __pyx_L1_error)

  /* "chorde/clients/async.py":1305
 *             self.task_time_max = task_time
 * 
 * class AsyncCacheProcessor(object):             # <<<<<<<<<<<<<<
 *     """
 *     An async cache processor will allow asynchronous reads
 */
  __pyx_tuple__245 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);

  /* "chorde/clients/async.py":1326
 *     """
 * 
 *     def __init__(self, workers, client,             # <<<<<<<<<<<<<<
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):
 */
  __pyx_tuple__246 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_workers, __pyx_n_s_client, __pyx_n_s_coalescence_buffer_size, __pyx_n_s_maxqueue, __pyx_n_s_cleanup_cycles, __pyx_n_s_threadpool); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 1326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __pyx_tuple__248 = PyTuple_Pack(4, ((PyObject *)__pyx_int_500), ((PyObject *)Py_None), ((PyObject *)__pyx_int_500), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__248);
  __Pyx_GIVEREF(__pyx_tuple__248);

  /* "chorde/clients/async.py":1355
 * 
 *     @property
 *     def threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._threadpool is None:
 *             with self._spawnlock:
 */
  __pyx_tuple__249 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_threadpool, 1355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 1355, __pyx_L1_error)

  /* "chorde/clients/async.py":1365
 *         return self._threadpool
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):             # <<<<<<<<<<<<<<
 *         logger = self.logger
 *         cfuture = future = Future(logger)
 */
  __pyx_tuple__251 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_action, __pyx_n_s_coalesce_2, __pyx_n_s_coalesce_key, __pyx_n_s_logger, __pyx_n_s_cfuture, __pyx_n_s_future, __pyx_n_s_do_coalescence, __pyx_n_s_waction, __pyx_n_s_cwaction, __pyx_n_s_maxqueue, __pyx_n_s_wself_2, __pyx_n_s_stats, __pyx_n_s_queue_time, __pyx_n_s_wrapped_action, __pyx_n_s_wrapped_action); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_enqueue, 1365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 1365, __pyx_L1_error)

  /* "chorde/clients/async.py":1468
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */
  __pyx_tuple__253 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(0, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_capacity, 1468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 1468, __pyx_L1_error)

  /* "chorde/clients/async.py":1472
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */
  __pyx_tuple__255 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);
  __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_usage, 1472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(0, 1472, __pyx_L1_error)

  /* "chorde/clients/async.py":1476
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 */
  __pyx_tuple__257 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_queuelen, 1476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 1476, __pyx_L1_error)

  /* "chorde/clients/async.py":1479
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 */
  __pyx_tuple__259 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_do_async, 1479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 1479, __pyx_L1_error)

  /* "chorde/clients/async.py":1482
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 *     def do_async_coalescent(self, coalesce, coalesce_key, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an already-queued future if there is one, or a new one if not.
 */
  __pyx_tuple__261 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_coalesce_2, __pyx_n_s_coalesce_key, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_do_async_coalescent, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 1482, __pyx_L1_error)

  /* "chorde/clients/async.py":1495
 *             coalesce, coalesce_key)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a proxy of this processor bound to the specified client instead.
 */
  __pyx_tuple__263 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_client); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_bound, 1495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 1495, __pyx_L1_error)

  /* "chorde/clients/async.py":1501
 *         return WrappedCacheProcessor(self, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */
  __pyx_tuple__265 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_kw, __pyx_n_s_ckey); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_getTtl, 1501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 1501, __pyx_L1_error)

  /* "chorde/clients/async.py":1512
 *             self.coalesce_getTtl, ckey)
 * 
 *     def get(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */
  __pyx_tuple__267 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_kw, __pyx_n_s_ckey); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_get, 1512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 1512, __pyx_L1_error)

  /* "chorde/clients/async.py":1523
 *             self.coalesce_get, ckey)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */
  __pyx_tuple__269 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_p, __pyx_n_s_kw, __pyx_n_s_ckey); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_contains_3, 1523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 1523, __pyx_L1_error)

  /* "chorde/clients/async.py":1533
 *             self.coalesce_contains, ckey)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 */
  __pyx_tuple__271 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_put, 1533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 1533, __pyx_L1_error)

  /* "chorde/clients/async.py":1536
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 */
  __pyx_tuple__273 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_renew, 1536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 1536, __pyx_L1_error)

  /* "chorde/clients/async.py":1539
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 */
  __pyx_tuple__275 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_add, 1539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(0, 1539, __pyx_L1_error)

  /* "chorde/clients/async.py":1542
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 */
  __pyx_tuple__277 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_delete, 1542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(0, 1542, __pyx_L1_error)

  /* "chorde/clients/async.py":1545
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 */
  __pyx_tuple__279 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_expire, 1545, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 1545, __pyx_L1_error)

  /* "chorde/clients/async.py":1548
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.clear)
 * 
 */
  __pyx_tuple__281 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clear, 1548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 1548, __pyx_L1_error)

  /* "chorde/clients/async.py":1551
 *         return self._enqueue(self.client.clear)
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.purge)
 * 
 */
  __pyx_tuple__283 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);
  __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_purge, 1551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(0, 1551, __pyx_L1_error)

  /* "chorde/clients/async.py":1554
 *         return self._enqueue(self.client.purge)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_tuple__285 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_task); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_cleanup, 1554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 1554, __pyx_L1_error)

  /* "chorde/clients/async.py":1563
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_tuple__287 = PyTuple_Pack(1, __pyx_n_s_task); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_default_cleanup, 1563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 1563, __pyx_L1_error)

  /* "chorde/clients/async.py":1572
 *         _global_cleanup_tasks.append(task)
 * 
 * class WrappedCacheProcessor(object):             # <<<<<<<<<<<<<<
 *     """
 *     Wraps an AsyncCacheProcessor, binding its interface to a
 */
  __pyx_tuple__289 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);

  /* "chorde/clients/async.py":1577
 *     different client.
 *     """
 *     def __init__(self, processor, client, coalescence_buffer_size = 500):             # <<<<<<<<<<<<<<
 *         self.processor = processor
 *         self.client = client
 */
  __pyx_tuple__290 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_processor, __pyx_n_s_client, __pyx_n_s_coalescence_buffer_size); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_init, 1577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __pyx_tuple__292 = PyTuple_Pack(1, ((PyObject *)__pyx_int_500)); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);

  /* "chorde/clients/async.py":1585
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */
  __pyx_tuple__293 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_capacity, 1585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 1585, __pyx_L1_error)

  /* "chorde/clients/async.py":1589
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */
  __pyx_tuple__295 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_usage, 1589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(0, 1589, __pyx_L1_error)

  /* "chorde/clients/async.py":1593
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self.processor.queuelen
 * 
 */
  __pyx_tuple__297 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_queuelen, 1593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 1593, __pyx_L1_error)

  /* "chorde/clients/async.py":1597
 * 
 *     @property
 *     def maxqueue(self):             # <<<<<<<<<<<<<<
 *         return self.processor.maxqueue
 * 
 */
  __pyx_tuple__299 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_maxqueue, 1597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 1597, __pyx_L1_error)

  /* "chorde/clients/async.py":1601
 * 
 *     @property
 *     def stats(self):             # <<<<<<<<<<<<<<
 *         return self.processor.stats
 * 
 */
  __pyx_tuple__301 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_stats, 1601, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(0, 1601, __pyx_L1_error)

  /* "chorde/clients/async.py":1604
 *         return self.processor.stats
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 */
  __pyx_tuple__303 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_do_async, 1604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 1604, __pyx_L1_error)

  /* "chorde/clients/async.py":1607
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         if client is self.client:
 *             return self
 */
  __pyx_tuple__305 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_client); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_bound, 1607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 1607, __pyx_L1_error)

  /* "chorde/clients/async.py":1613
 *             return WrappedCacheProcessor(self.processor, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw:
 *             if default is NONE:
 */
  __pyx_tuple__307 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_kw, __pyx_n_s_ckey); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_getTtl, 1613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 1613, __pyx_L1_error)

  /* "chorde/clients/async.py":1624
 *             self.client.getTtl, key, default, **kw)
 * 
 *     def get(self, key, default = NONE):             # <<<<<<<<<<<<<<
 *         if default is NONE:
 *             ckey = key
 */
  __pyx_tuple__309 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_ckey); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_get, 1624, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 1624, __pyx_L1_error)

  /* "chorde/clients/async.py":1632
 *             self.client.get, key, default)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */
  __pyx_tuple__311 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_p, __pyx_n_s_kw, __pyx_n_s_ckey); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_contains_3, 1632, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 1632, __pyx_L1_error)

  /* "chorde/clients/async.py":1642
 *             self.client.contains, key, *p, **kw)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 */
  __pyx_tuple__313 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_put, 1642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(0, 1642, __pyx_L1_error)

  /* "chorde/clients/async.py":1645
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 */
  __pyx_tuple__315 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_renew, 1645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 1645, __pyx_L1_error)

  /* "chorde/clients/async.py":1648
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 */
  __pyx_tuple__317 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_ttl, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_add, 1648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 1648, __pyx_L1_error)

  /* "chorde/clients/async.py":1651
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.delete, key)
 * 
 */
  __pyx_tuple__319 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_delete, 1651, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 1651, __pyx_L1_error)

  /* "chorde/clients/async.py":1654
 *         return self.processor.do_async(self.client.delete, key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.expire, key)
 * 
 */
  __pyx_tuple__321 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_expire, 1654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 1654, __pyx_L1_error)

  /* "chorde/clients/async.py":1657
 *         return self.processor.do_async(self.client.expire, key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.clear)
 * 
 */
  __pyx_tuple__323 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_clear, 1657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 1657, __pyx_L1_error)

  /* "chorde/clients/async.py":1660
 *         return self.processor.do_async(self.client.clear)
 * 
 *     def purge(self, *p, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 */
  __pyx_tuple__325 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_p, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);
  __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_purge, 1660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) __PYX_ERR(0, 1660, __pyx_L1_error)

  /* "chorde/clients/async.py":1663
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         self.processor.register_cleanup(task)
 * 
 */
  __pyx_tuple__327 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_task); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__327);
  __Pyx_GIVEREF(__pyx_tuple__327);
  __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_cleanup, 1663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) __PYX_ERR(0, 1663, __pyx_L1_error)

  /* "chorde/clients/async.py":1667
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         AsyncCacheProcessor.register_default_cleanup(task)
 */
  __pyx_tuple__329 = PyTuple_Pack(1, __pyx_n_s_task); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);
  __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_chorde_clients_async_py, __pyx_n_s_register_default_cleanup, 1667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_viewkeys.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_05 = PyFloat_FromDouble(0.05); if (unlikely(!__pyx_float_0_05)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_500 = PyInt_FromLong(500); if (unlikely(!__pyx_int_500)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct__getTtlMulti;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_1_getMulti = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_1_getMulti;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value) < 0) __PYX_ERR(0, 997, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_2_on_value = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_2_on_value;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss) < 0) __PYX_ERR(0, 1007, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_3_on_miss = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_3_on_miss;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc) < 0) __PYX_ERR(0, 1017, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_4_on_exc = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_4_on_exc;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any) < 0) __PYX_ERR(0, 1027, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_5_on_any = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_5_on_any;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done) < 0) __PYX_ERR(0, 1051, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_6_on_done = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_6_on_done;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_7_chain_std = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_7_chain_std;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_8_add_done_callback;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf) < 0) __PYX_ERR(0, 1235, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_9_mkf = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_9_mkf;
  if (PyType_Ready(&__pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue.tp_dictoffset && __pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6chorde_7clients_5async___pyx_scope_struct_10__enqueue = &__pyx_type_6chorde_7clients_5async___pyx_scope_struct_10__enqueue;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initasync(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initasync(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_async(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_async(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_async(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'async' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_async(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("async", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_chorde__clients__async) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "chorde.clients.async")) {
      if (unlikely(PyDict_SetItemString(modules, "chorde.clients.async", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "chorde/clients/async.py":1
 * from chorde.serialize import serialize             # <<<<<<<<<<<<<<
 * 
 * import logging
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_serialize);
  __Pyx_GIVEREF(__pyx_n_s_serialize);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_serialize);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_chorde_serialize, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_serialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":3
 * from chorde.serialize import serialize
 * 
 * import logging             # <<<<<<<<<<<<<<
 * import time
 * import weakref
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":4
 * 
 * import logging
 * import time             # <<<<<<<<<<<<<<
 * import weakref
 * import functools
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":5
 * import logging
 * import time
 * import weakref             # <<<<<<<<<<<<<<
 * import functools
 * import itertools
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":6
 * import time
 * import weakref
 * import functools             # <<<<<<<<<<<<<<
 * import itertools
 * import thread
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_functools, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":7
 * import weakref
 * import functools
 * import itertools             # <<<<<<<<<<<<<<
 * import thread
 * import threading
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":8
 * import functools
 * import itertools
 * import thread             # <<<<<<<<<<<<<<
 * import threading
 * import operator
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_thread, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":9
 * import itertools
 * import thread
 * import threading             # <<<<<<<<<<<<<<
 * import operator
 * import sys
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":10
 * import thread
 * import threading
 * import operator             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":11
 * import threading
 * import operator
 * import sys             # <<<<<<<<<<<<<<
 * 
 * # No need for real multiprocessing. In fact, using real
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":16
 * # multiprocessing would force pickling of values, which would be
 * # undesirable, pushing pickling cost into foreground threads.
 * import multiprocessing.dummy             # <<<<<<<<<<<<<<
 * import multiprocessing.pool
 * from chorde.threadpool import ThreadPool
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_multiprocessing_dummy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":17
 * # undesirable, pushing pickling cost into foreground threads.
 * import multiprocessing.dummy
 * import multiprocessing.pool             # <<<<<<<<<<<<<<
 * from chorde.threadpool import ThreadPool
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_multiprocessing_pool, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":18
 * import multiprocessing.dummy
 * import multiprocessing.pool
 * from chorde.threadpool import ThreadPool             # <<<<<<<<<<<<<<
 * 
 * from .base import BaseCacheClient, CacheMissError, NONE, TimeoutError, CancelledError
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ThreadPool);
  __Pyx_GIVEREF(__pyx_n_s_ThreadPool);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ThreadPool);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_chorde_threadpool, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ThreadPool, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":20
 * from chorde.threadpool import ThreadPool
 * 
 * from .base import BaseCacheClient, CacheMissError, NONE, TimeoutError, CancelledError             # <<<<<<<<<<<<<<
 * from .inproc import Cache
 * 
 */
  __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_BaseCacheClient);
  __Pyx_GIVEREF(__pyx_n_s_BaseCacheClient);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BaseCacheClient);
  __Pyx_INCREF(__pyx_n_s_CacheMissError);
  __Pyx_GIVEREF(__pyx_n_s_CacheMissError);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CacheMissError);
  __Pyx_INCREF(__pyx_n_s_NONE_2);
  __Pyx_GIVEREF(__pyx_n_s_NONE_2);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_NONE_2);
  __Pyx_INCREF(__pyx_n_s_TimeoutError);
  __Pyx_GIVEREF(__pyx_n_s_TimeoutError);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_TimeoutError);
  __Pyx_INCREF(__pyx_n_s_CancelledError);
  __Pyx_GIVEREF(__pyx_n_s_CancelledError);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_CancelledError);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_base, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BaseCacheClient); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BaseCacheClient, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CacheMissError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CacheMissError, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE_2, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeoutError, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CancelledError, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "chorde/clients/async.py":21
 * 
 * from .base import BaseCacheClient, CacheMissError, NONE, TimeoutError, CancelledError
 * from .inproc import Cache             # <<<<<<<<<<<<<<
 * 
 * class _NONE:pass
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Cache);
  __Pyx_GIVEREF(__pyx_n_s_Cache);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Cache);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_inproc, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cache, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":23
 * from .inproc import Cache
 * 
 * class _NONE:pass             # <<<<<<<<<<<<<<
 * class _DELETE:pass
 * class _EXPIRE:pass
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_NONE, __pyx_n_s_NONE, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_NONE, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":24
 * 
 * class _NONE:pass
 * class _DELETE:pass             # <<<<<<<<<<<<<<
 * class _EXPIRE:pass
 * class _PURGE:pass
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_DELETE, __pyx_n_s_DELETE, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_DELETE, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":25
 * class _NONE:pass
 * class _DELETE:pass
 * class _EXPIRE:pass             # <<<<<<<<<<<<<<
 * class _PURGE:pass
 * class _CLEAR:pass
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_EXPIRE, __pyx_n_s_EXPIRE, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_EXPIRE, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPIRE, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":26
 * class _DELETE:pass
 * class _EXPIRE:pass
 * class _PURGE:pass             # <<<<<<<<<<<<<<
 * class _CLEAR:pass
 * class _RENEW:pass
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PURGE, __pyx_n_s_PURGE, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_PURGE, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PURGE, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":27
 * class _EXPIRE:pass
 * class _PURGE:pass
 * class _CLEAR:pass             # <<<<<<<<<<<<<<
 * class _RENEW:pass
 * class REGET:pass
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_CLEAR, __pyx_n_s_CLEAR, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_CLEAR, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEAR, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":28
 * class _PURGE:pass
 * class _CLEAR:pass
 * class _RENEW:pass             # <<<<<<<<<<<<<<
 * class REGET:pass
 * 
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_RENEW, __pyx_n_s_RENEW, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_RENEW, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RENEW, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":29
 * class _CLEAR:pass
 * class _RENEW:pass
 * class REGET:pass             # <<<<<<<<<<<<<<
 * 
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_REGET, __pyx_n_s_REGET, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_REGET, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_REGET, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":31
 * class REGET:pass
 * 
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])             # <<<<<<<<<<<<<<
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):
 */
  __pyx_t_1 = __Pyx_PyFrozenSet_New(__pyx_tuple__41); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COALESCE_IGNORE_KWARGS, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "chorde/clients/async.py":32
 * 
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))             # <<<<<<<<<<<<<<
 * def is_special(value):
 *     return id(value) in SPECIAL
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PURGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_REGET); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyList_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyList_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_builtin_id);
  __Pyx_GIVEREF(__pyx_builtin_id);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_builtin_id);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PySet_New(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SPECIAL, __pyx_t_7) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":33
 * COALESCE_IGNORE_KWARGS = frozenset(['promote_callback'])
 * SPECIAL = set(map(id,[_NONE, _DELETE, _EXPIRE, _PURGE, _CLEAR, _RENEW, REGET]))
 * def is_special(value):             # <<<<<<<<<<<<<<
 *     return id(value) in SPECIAL
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_1is_special, 0, __pyx_n_s_is_special, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_special, __pyx_t_7) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":36
 *     return id(value) in SPECIAL
 * 
 * class Defer(object):             # <<<<<<<<<<<<<<
 *     """
 *     Wrap a callable in this, and pass it as a value to an AsyncWriteCacheClient,
 */
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__44); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__44, __pyx_n_s_Defer, __pyx_n_s_Defer, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, __pyx_kp_s_Wrap_a_callable_in_this_and_pas); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":50
 *     """
 * 
 *     def __init__(self, callable_, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.callable_ = callable_
 *         self.args = args
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_5Defer_1__init__, 0, __pyx_n_s_Defer___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":56
 *         self.lazy = False
 * 
 *     def undefer(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is None or future.set_running_or_notify_cancelled():
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_5Defer_3undefer, 0, __pyx_n_s_Defer_undefer, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 56, __pyx_L1_error)
  __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_6)->__pyx_arg_getattr = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_6chorde_7clients_5async_6__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_undefer, __pyx_t_6) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":73
 *             return _NONE
 * 
 *     def set(self, value):             # <<<<<<<<<<<<<<
 *         self.rv = value
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_5Defer_5set, 0, __pyx_n_s_Defer_set, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_set, __pyx_t_6) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":76
 *         self.rv = value
 * 
 *     def done(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *         future = getattr(self, 'future', None)
 *         if future is not None and not future.done():
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_5Defer_7done, 0, __pyx_n_s_Defer_done, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 76, __pyx_L1_error)
  __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_6)->__pyx_arg_getattr = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_6chorde_7clients_5async_8__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_done, __pyx_t_6) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":36
 *     return id(value) in SPECIAL
 * 
 * class Defer(object):             # <<<<<<<<<<<<<<
 *     """
 *     Wrap a callable in this, and pass it as a value to an AsyncWriteCacheClient,
 */
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Defer, __pyx_tuple__44, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Defer, __pyx_t_6) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":85
 *                 future.set(rv)
 * 
 * def _renew_undefer(self, key, ttl, kw, value):             # <<<<<<<<<<<<<<
 *     self = self()
 *     self.client.renew(key, ttl, **(kw or {}))
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_3_renew_undefer, 0, __pyx_n_s_renew_undefer, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_renew_undefer, __pyx_t_7) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":90
 *     return value.undefer()
 * 
 * _global_cleanup_tasks = []             # <<<<<<<<<<<<<<
 * 
 * class AsyncCacheWriterThreadPool(ThreadPool):
 */
  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_global_cleanup_tasks, __pyx_t_7) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":92
 * _global_cleanup_tasks = []
 * 
 * class AsyncCacheWriterThreadPool(ThreadPool):             # <<<<<<<<<<<<<<
 *     class AsyncCacheWriterThread(ThreadPool.Process):
 *         pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_8, __pyx_n_s_AsyncCacheWriterThreadPool, __pyx_n_s_AsyncCacheWriterThreadPool, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":93
 * 
 * class AsyncCacheWriterThreadPool(ThreadPool):
 *     class AsyncCacheWriterThread(ThreadPool.Process):             # <<<<<<<<<<<<<<
 *         pass
 *     Process = AsyncCacheWriterThread
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_n_s_AsyncCacheWriterThread, __pyx_n_s_AsyncCacheWriterThreadPool_Async, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_AsyncCacheWriterThread, __pyx_t_5, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_AsyncCacheWriterThread, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":95
 *     class AsyncCacheWriterThread(ThreadPool.Process):
 *         pass
 *     Process = AsyncCacheWriterThread             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, workers):
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_AsyncCacheWriterThread);
  if (unlikely(!__pyx_t_5)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_AsyncCacheWriterThread);
  }
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_Process, __pyx_t_5) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":97
 *     Process = AsyncCacheWriterThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_26AsyncCacheWriterThreadPool_1__init__, 0, __pyx_n_s_AsyncCacheWriterThreadPool___ini, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":92
 * _global_cleanup_tasks = []
 * 
 * class AsyncCacheWriterThreadPool(ThreadPool):             # <<<<<<<<<<<<<<
 *     class AsyncCacheWriterThread(ThreadPool.Process):
 *         pass
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_AsyncCacheWriterThreadPool, __pyx_t_8, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncCacheWriterThreadPool, __pyx_t_5) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":107
 *         ThreadPool.__init__(self, workers)
 * 
 * class AsyncCacheWriterPool:             # <<<<<<<<<<<<<<
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,
 *             defer_threadpool = None, writer_threadpool = None):
 */
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_AsyncCacheWriterPool, __pyx_n_s_AsyncCacheWriterPool, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":108
 * 
 * class AsyncCacheWriterPool:
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_1__init__, 0, __pyx_n_s_AsyncCacheWriterPool___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__59);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":144
 * 
 *     @property
 *     def defer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._defer_threadpool is None:
 *             with self._spawnlock:
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_3defer_threadpool, 0, __pyx_n_s_AsyncCacheWriterPool_defer_threa, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "chorde/clients/async.py":143
 *         self.cleanup_cycles = cleanup_cycles
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def defer_threadpool(self):
 *         if self._defer_threadpool is None:
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_defer_threadpool, __pyx_t_6) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":155
 * 
 *     @property
 *     def writer_threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._writer_threadpool is None:
 *             with self._spawnlock:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_5writer_threadpool, 0, __pyx_n_s_AsyncCacheWriterPool_writer_thre, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":154
 *         return self._defer_threadpool
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def writer_threadpool(self):
 *         if self._writer_threadpool is None:
 */
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_writer_threadpool, __pyx_t_7) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":166
 * 
 *     @staticmethod
 *     def _writer(self, key, reentrant = True):             # <<<<<<<<<<<<<<
 *         # self is weakref
 *         self = self()
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_7_writer, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_AsyncCacheWriterPool__writer, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__66);

  /* "chorde/clients/async.py":165
 *         return self._writer_threadpool
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def _writer(self, key, reentrant = True):
 *         # self is weakref
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_writer, __pyx_t_6) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":287
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_9capacity, 0, __pyx_n_s_AsyncCacheWriterPool_capacity, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":286
 *             self.logger.error("Error during cleanup", exc_info = True)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def capacity(self):
 *         return self.size
 */
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_capacity, __pyx_t_7) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":291
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return len(self.queueset)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_11usage, 0, __pyx_n_s_AsyncCacheWriterPool_usage, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "chorde/clients/async.py":290
 *         return self.size
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def usage(self):
 *         return len(self.queueset)
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_usage, __pyx_t_6) < 0) __PYX_ERR(0, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":294
 *         return len(self.queueset)
 * 
 *     @serialize             # <<<<<<<<<<<<<<
 *     def dequeue(self, key):
 *         rv = self.queueset.pop(key, _NONE)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_serialize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "chorde/clients/async.py":295
 * 
 *     @serialize
 *     def dequeue(self, key):             # <<<<<<<<<<<<<<
 *         rv = self.queueset.pop(key, _NONE)
 *         self.workset[key] = thread.get_ident(), rv, threading.Event()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_13dequeue, 0, __pyx_n_s_AsyncCacheWriterPool_dequeue, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_dequeue, __pyx_t_6) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":300
 *         return rv
 * 
 *     @serialize             # <<<<<<<<<<<<<<
 *     def drop_one(self):
 *         for key in self.queueset:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_serialize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "chorde/clients/async.py":301
 * 
 *     @serialize
 *     def drop_one(self):             # <<<<<<<<<<<<<<
 *         for key in self.queueset:
 *             break
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_15drop_one, 0, __pyx_n_s_AsyncCacheWriterPool_drop_one, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_drop_one, __pyx_t_6) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":309
 *         return rv
 * 
 *     def enqueue(self, key, value, ttl=None, **kw):             # <<<<<<<<<<<<<<
 *         if (thread.get_ident() in self.threadset
 *                  or (hasattr(self.defer_threadpool, 'in_worker') and self.defer_threadpool.in_worker()) ):
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_17enqueue, 0, __pyx_n_s_AsyncCacheWriterPool_enqueue, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__78);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_enqueue_2, __pyx_t_6) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":348
 *                 delayed()
 * 
 *     @serialize             # <<<<<<<<<<<<<<
 *     def clearqueue(self):
 *         delayed = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_serialize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "chorde/clients/async.py":349
 * 
 *     @serialize
 *     def clearqueue(self):             # <<<<<<<<<<<<<<
 *         delayed = []
 *         for entry in self.queueset.itervalues():
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_19clearqueue, 0, __pyx_n_s_AsyncCacheWriterPool_clearqueue, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_clearqueue, __pyx_t_6) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":360
 *         return delayed
 * 
 *     def _coalesce(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_21_coalesce, 0, __pyx_n_s_AsyncCacheWriterPool__coalesce, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_coalesce, __pyx_t_6) < 0) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":405
 *         return delayed
 * 
 *     @serialize             # <<<<<<<<<<<<<<
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):
 *         delayed = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_serialize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "chorde/clients/async.py":406
 * 
 *     @serialize
 *     def _enqueue(self, key, value, ttl, isinstance=isinstance, getattr=getattr, hasattr=hasattr, **kw):             # <<<<<<<<<<<<<<
 *         delayed = None
 *         queueset = self.queueset
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_23_enqueue, 0, __pyx_n_s_AsyncCacheWriterPool__enqueue, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults2), 3)) __PYX_ERR(0, 406, __pyx_L1_error)
  __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_isinstance); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_5)->__pyx_arg_isinstance = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_5)->__pyx_arg_getattr = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_5)->__pyx_arg_hasattr = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_6chorde_7clients_5async_10__defaults__);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_enqueue, __pyx_t_6) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":451
 *         return delayed
 * 
 *     def waitkey(self, key, timeout=None):             # <<<<<<<<<<<<<<
 *         tid = thread.get_ident()
 *         if (tid in self.threadset
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_25waitkey, 0, __pyx_n_s_AsyncCacheWriterPool_waitkey, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__87);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_waitkey, __pyx_t_6) < 0) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":513
 *                 timeout = tfin - time_time()
 * 
 *     def getTtl(self, key, default = None):             # <<<<<<<<<<<<<<
 *         # Speeding up things - we have the same signature and semantics
 *         self.getTtl = getTtl = self.queueset.get
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_27getTtl, 0, __pyx_n_s_AsyncCacheWriterPool_getTtl, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__90);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_getTtl, __pyx_t_6) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":518
 *         return getTtl(key, default)
 * 
 *     def contains(self, key):             # <<<<<<<<<<<<<<
 *         # Not atomic, but it doesn't really matter much, very unlikely and benignly to fail
 *         if key in self.queueset:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_29contains, 0, __pyx_n_s_AsyncCacheWriterPool_contains, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_contains_3, __pyx_t_6) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":528
 *             return self.workset.get(key, (tid,))[0] != tid
 * 
 *     def _contains(self, key):             # <<<<<<<<<<<<<<
 *         # Fast version of contains that doesn't check the workset
 *         # Useful for special-purpose checks, like contains(CLEAR)
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_31_contains, 0, __pyx_n_s_AsyncCacheWriterPool__contains, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_contains_2, __pyx_t_6) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":534
 *         return _contains(key)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, value, ttl, **kw)
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_33put, 0, __pyx_n_s_AsyncCacheWriterPool_put, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":537
 *         self.enqueue(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         # Don't schedule a renew if another thing is queued on the key
 *         # It causes... issues
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_35renew, 0, __pyx_n_s_AsyncCacheWriterPool_renew, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_renew, __pyx_t_6) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":543
 *             self.enqueue(key, _RENEW, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _DELETE)
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_37delete, 0, __pyx_n_s_AsyncCacheWriterPool_delete, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_delete, __pyx_t_6) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":546
 *         self.enqueue(key, _DELETE)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.enqueue(key, _EXPIRE)
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_39expire, 0, __pyx_n_s_AsyncCacheWriterPool_expire, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_expire, __pyx_t_6) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":549
 *         self.enqueue(key, _EXPIRE)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         delayed = self.clearqueue()
 *         self.enqueue(_CLEAR, _CLEAR)
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_41clear, 0, __pyx_n_s_AsyncCacheWriterPool_clear, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_clear, __pyx_t_6) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":558
 *                 pass
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         self.enqueue(_PURGE, _PURGE)
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_43purge, 0, __pyx_n_s_AsyncCacheWriterPool_purge, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_purge, __pyx_t_6) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":561
 *         self.enqueue(_PURGE, _PURGE)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_45register_cleanup, 0, __pyx_n_s_AsyncCacheWriterPool_register_cl, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_register_cleanup, __pyx_t_6) < 0) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":570
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_20AsyncCacheWriterPool_47register_default_cleanup, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_AsyncCacheWriterPool_register_de, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":569
 *         self.cleanup_tasks.append(task)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def register_default_cleanup(task):
 *         """
 */
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_register_default_cleanup, __pyx_t_7) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":107
 *         ThreadPool.__init__(self, workers)
 * 
 * class AsyncCacheWriterPool:             # <<<<<<<<<<<<<<
 *     def __init__(self, size, workers, client, overflow = False, cleanup_cycles = 500,
 *             defer_threadpool = None, writer_threadpool = None):
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_AsyncCacheWriterPool, __pyx_empty_tuple, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncCacheWriterPool, __pyx_t_7) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":579
 *         _global_cleanup_tasks.append(task)
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):             # <<<<<<<<<<<<<<
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,
 *             defer_threadpool = None, writer_threadpool = None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BaseCacheClient); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_AsyncWriteCacheClient, __pyx_n_s_AsyncWriteCacheClient, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":580
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,             # <<<<<<<<<<<<<<
 *             defer_threadpool = None, writer_threadpool = None):
 *         self.client = client
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_1__init__, 0, __pyx_n_s_AsyncWriteCacheClient___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__113);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":591
 *         self._writer_threadpool = writer_threadpool or threadpool
 * 
 *     def assert_started(self):             # <<<<<<<<<<<<<<
 *         if self.writer is None:
 *             with self.spawning_lock:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_3assert_started, 0, __pyx_n_s_AsyncWriteCacheClient_assert_sta, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_assert_started, __pyx_t_5) < 0) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":603
 *                         writer_threadpool = self._writer_threadpool)
 * 
 *     def is_started(self):             # <<<<<<<<<<<<<<
 *         return self.writer is not None
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_5is_started, 0, __pyx_n_s_AsyncWriteCacheClient_is_started, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_started, __pyx_t_5) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":606
 *         return self.writer is not None
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             raise AssertionError, "Starting AsyncCacheClient twice"
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_7start, 0, __pyx_n_s_AsyncWriteCacheClient_start, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_start, __pyx_t_5) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":611
 *         self.assert_started()
 * 
 *     def stop(self, abort_tasks=False):             # <<<<<<<<<<<<<<
 *         if self.writer is not None:
 *             if not abort_tasks:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_9stop, 0, __pyx_n_s_AsyncWriteCacheClient_stop, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__122);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_stop, __pyx_t_5) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":618
 * 
 *     @property
 *     def async(self):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_11async, 0, __pyx_n_s_AsyncWriteCacheClient_async, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "chorde/clients/async.py":617
 *             self.writer.terminate()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def async(self):
 *         return True
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_async, __pyx_t_4) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":622
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_13capacity, 0, __pyx_n_s_AsyncWriteCacheClient_capacity, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":621
 *         return True
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def capacity(self):
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_capacity, __pyx_t_5) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "chorde/clients/async.py":626
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_15usage, 0, __pyx_n_s_AsyncWriteCacheClient_usage, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "chorde/clients/async.py":625
 *         return (self.client.capacity, self.writer.capacity if self.writer is not None else 0)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def usage(self):
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_usage, __pyx_t_4) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":629
 *         return (self.client.usage, self.writer.usage if self.writer is not None else 0)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.put(key, value, ttl, **kw)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_17put, 0, __pyx_n_s_AsyncWriteCacheClient_put, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_put, __pyx_t_4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":633
 *         self.writer.put(key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.renew(key, ttl, **kw)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_19renew, 0, __pyx_n_s_AsyncWriteCacheClient_renew, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_renew, __pyx_t_4) < 0) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":637
 *         self.writer.renew(key, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.delete(key)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_21delete, 0, __pyx_n_s_AsyncWriteCacheClient_delete, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_delete, __pyx_t_4) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":641
 *         self.writer.delete(key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         self.assert_started()
 *         self.writer.expire(key)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_23expire, 0, __pyx_n_s_AsyncWriteCacheClient_expire, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_expire, __pyx_t_4) < 0) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":645
 *         self.writer.expire(key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             self.writer.clear()
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_25clear, 0, __pyx_n_s_AsyncWriteCacheClient_clear, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_clear, __pyx_t_4) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":649
 *             self.writer.clear()
 * 
 *     def purge(self, timeout = None):             # <<<<<<<<<<<<<<
 *         """
 *         Timeout is ignored
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_27purge, 0, __pyx_n_s_AsyncWriteCacheClient_purge, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__141);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_purge, __pyx_t_4) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":656
 *             self.writer.purge()
 * 
 *     def getTtl(self, key, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_29getTtl, 0, __pyx_n_s_AsyncWriteCacheClient_getTtl, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults3), 8)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg_default = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":657
 * 
 *     def getTtl(self, key, default = NONE,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,             # <<<<<<<<<<<<<<
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg__DELETE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg__EXPIRE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg__RENEW = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg__CLEAR = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":658
 *     def getTtl(self, key, default = NONE,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,             # <<<<<<<<<<<<<<
 *             hasattr = hasattr,
 *             **kw):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg_NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg__NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":659
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,             # <<<<<<<<<<<<<<
 *             **kw):
 *         ettl = None
 */
  __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg_hasattr = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_6chorde_7clients_5async_12__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getTtl, __pyx_t_4) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":702
 *             return value, ttl
 * 
 *     def get(self, key, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_31get, 0, __pyx_n_s_AsyncWriteCacheClient_get, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults4), 8)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg_default = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":703
 * 
 *     def get(self, key, default = NONE, ttl_skip = None,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,             # <<<<<<<<<<<<<<
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg__DELETE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg__EXPIRE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg__RENEW = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg__CLEAR = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":704
 *     def get(self, key, default = NONE, ttl_skip = None,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,             # <<<<<<<<<<<<<<
 *             hasattr = hasattr,
 *             **kw):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg_NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg__NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":705
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,             # <<<<<<<<<<<<<<
 *             **kw):
 *         writer = self.writer
 */
  __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg_hasattr = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_6chorde_7clients_5async_14__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_get, __pyx_t_4) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":739
 *         return self.client.get(key, default, ttl_skip = ttl_skip, **kw)
 * 
 *     def getTtlMulti(self, keys, default = NONE,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_33getTtlMulti, 0, __pyx_n_s_AsyncWriteCacheClient_getTtlMult, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults5), 8)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_default = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":740
 * 
 *     def getTtlMulti(self, keys, default = NONE,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,             # <<<<<<<<<<<<<<
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg__DELETE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg__EXPIRE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg__RENEW = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg__CLEAR = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":741
 *     def getTtlMulti(self, keys, default = NONE,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,             # <<<<<<<<<<<<<<
 *             hasattr = hasattr,
 *             **kw):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg__NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":742
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,             # <<<<<<<<<<<<<<
 *             **kw):
 *         ettl = {}
 */
  __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_hasattr = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_6chorde_7clients_5async_16__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getTtlMulti, __pyx_t_4) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":787
 *             yield key, (value, ttl)
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,             # <<<<<<<<<<<<<<
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_36getMulti, 0, __pyx_n_s_AsyncWriteCacheClient_getMulti, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults6), 8)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg_default = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":788
 * 
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,             # <<<<<<<<<<<<<<
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_DELETE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg__DELETE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_EXPIRE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg__EXPIRE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RENEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg__RENEW = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CLEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg__CLEAR = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":789
 *     def getMulti(self, keys, default = NONE, ttl_skip = None,
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,             # <<<<<<<<<<<<<<
 *             hasattr = hasattr,
 *             **kw):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg_NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg__NONE = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "chorde/clients/async.py":790
 *             _DELETE = _DELETE, _EXPIRE = _EXPIRE, _RENEW = _RENEW, _CLEAR = _CLEAR,
 *             NONE = NONE, _NONE = _NONE,
 *             hasattr = hasattr,             # <<<<<<<<<<<<<<
 *             **kw):
 *         ettl = []
 */
  __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg_hasattr = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_6chorde_7clients_5async_18__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getMulti, __pyx_t_4) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":839
 *                 yield key, value
 * 
 *     def promote(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             return
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_39promote, 0, __pyx_n_s_AsyncWriteCacheClient_promote, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_promote, __pyx_t_4) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":845
 *             return self.client.promote(key, *p, **kw)
 * 
 *     def wait(self, key, timeout = None):             # <<<<<<<<<<<<<<
 *         if self.is_started() and self.writer.contains(key):
 *             self.writer.waitkey(key, timeout)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_41wait, 0, __pyx_n_s_AsyncWriteCacheClient_wait, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__152);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_wait, __pyx_t_4) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":849
 *             self.writer.waitkey(key, timeout)
 * 
 *     def contains(self, key, ttl = None, **kw):             # <<<<<<<<<<<<<<
 *         if self.is_started():
 *             if self.writer.contains(key):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_43contains, 0, __pyx_n_s_AsyncWriteCacheClient_contains, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__155);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_contains_3, __pyx_t_4) < 0) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":859
 * 
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_45register_cleanup, 0, __pyx_n_s_AsyncWriteCacheClient_register_c, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_register_cleanup, __pyx_t_4) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":867
 *         self.writer.register_cleanup(task)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_47__str__, 0, __pyx_n_s_AsyncWriteCacheClient___str, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":870
 *         return "<%s of %r>" % (self.__class__.__name__, self.client)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21AsyncWriteCacheClient_49__repr__, 0, __pyx_n_s_AsyncWriteCacheClient___repr, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":579
 *         _global_cleanup_tasks.append(task)
 * 
 * class AsyncWriteCacheClient(BaseCacheClient):             # <<<<<<<<<<<<<<
 *     def __init__(self, client, writer_queue_size, writer_workers = None, overflow = False, threadpool = None,
 *             defer_threadpool = None, writer_threadpool = None):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_AsyncWriteCacheClient, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncWriteCacheClient, __pyx_t_4) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":873
 *         return str(self)
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from ._async import ExceptionWrapper, Future
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "chorde/clients/async.py":874
 * 
 * try:
 *     from ._async import ExceptionWrapper, Future             # <<<<<<<<<<<<<<
 * except ImportError:
 *     import warnings
 */
      __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_n_s_ExceptionWrapper);
      __Pyx_GIVEREF(__pyx_n_s_ExceptionWrapper);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_ExceptionWrapper);
      __Pyx_INCREF(__pyx_n_s_Future);
      __Pyx_GIVEREF(__pyx_n_s_Future);
      PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_Future);
      __pyx_t_8 = __Pyx_Import(__pyx_n_s_async_2, __pyx_t_7, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_ExceptionWrapper); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExceptionWrapper, __pyx_t_7) < 0) __PYX_ERR(0, 874, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_Future); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 874, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Future, __pyx_t_7) < 0) __PYX_ERR(0, 874, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "chorde/clients/async.py":873
 *         return str(self)
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from ._async import ExceptionWrapper, Future
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "chorde/clients/async.py":875
 * try:
 *     from ._async import ExceptionWrapper, Future
 * except ImportError:             # <<<<<<<<<<<<<<
 *     import warnings
 *     warnings.warn("_async extension module not built in, "
 */
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("chorde.clients.async", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 875, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "chorde/clients/async.py":876
 *     from ._async import ExceptionWrapper, Future
 * except ImportError:
 *     import warnings             # <<<<<<<<<<<<<<
 *     warnings.warn("_async extension module not built in, "
 *         "using pure-python version which is not atomic and requires"
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_4) < 0) __PYX_ERR(0, 876, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "chorde/clients/async.py":877
 * except ImportError:
 *     import warnings
 *     warnings.warn("_async extension module not built in, "             # <<<<<<<<<<<<<<
 *         "using pure-python version which is not atomic and requires"
 *         "explicit synchronization. Decreased performance will be noticeable")
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "chorde/clients/async.py":880
 *         "using pure-python version which is not atomic and requires"
 *         "explicit synchronization. Decreased performance will be noticeable")
 *     del warnings             # <<<<<<<<<<<<<<
 * 
 *     class ExceptionWrapper(object):  # lint:ok
 */
      if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_warnings) < 0) __PYX_ERR(0, 880, __pyx_L4_except_error)

      /* "chorde/clients/async.py":882
 *     del warnings
 * 
 *     class ExceptionWrapper(object):  # lint:ok             # <<<<<<<<<<<<<<
 *         __slots__ = ('value',)
 * 
 */
      __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__163); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_tuple__163, __pyx_n_s_ExceptionWrapper, __pyx_n_s_ExceptionWrapper, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "chorde/clients/async.py":883
 * 
 *     class ExceptionWrapper(object):  # lint:ok
 *         __slots__ = ('value',)             # <<<<<<<<<<<<<<
 * 
 *         def __init__(self, value):
 */
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_slots, __pyx_tuple__164) < 0) __PYX_ERR(0, 883, __pyx_L4_except_error)

      /* "chorde/clients/async.py":885
 *         __slots__ = ('value',)
 * 
 *         def __init__(self, value):             # <<<<<<<<<<<<<<
 *             self.value = value
 * 
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_16ExceptionWrapper_1__init__, 0, __pyx_n_s_ExceptionWrapper___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 885, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":888
 *             self.value = value
 * 
 *         def reraise(self):             # <<<<<<<<<<<<<<
 *             exc = self.value
 *             del self.value
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_16ExceptionWrapper_3reraise, 0, __pyx_n_s_ExceptionWrapper_reraise, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_reraise, __pyx_t_3) < 0) __PYX_ERR(0, 888, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":882
 *     del warnings
 * 
 *     class ExceptionWrapper(object):  # lint:ok             # <<<<<<<<<<<<<<
 *         __slots__ = ('value',)
 * 
 */
      __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_ExceptionWrapper, __pyx_tuple__163, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExceptionWrapper, __pyx_t_3) < 0) __PYX_ERR(0, 882, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "chorde/clients/async.py":893
 *             raise exc[0], exc[1], exc[2]
 * 
 *     class Future(object):  # lint:ok             # <<<<<<<<<<<<<<
 *         __slots__ = (
 *             '_cb', '_value', '_logger', '_running', '_cancel_pending', '_cancelled', '_done_event',
 */
      __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__169); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_tuple__169, __pyx_n_s_Future, __pyx_n_s_Future, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "chorde/clients/async.py":895
 *     class Future(object):  # lint:ok
 *         __slots__ = (
 *             '_cb', '_value', '_logger', '_running', '_cancel_pending', '_cancelled', '_done_event',             # <<<<<<<<<<<<<<
 *             '_lock', '__weakref__',
 *         )
 */
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_slots, __pyx_tuple__170) < 0) __PYX_ERR(0, 894, __pyx_L4_except_error)

      /* "chorde/clients/async.py":899
 *         )
 * 
 *         def __init__(self, logger = None):             # <<<<<<<<<<<<<<
 *             self._cb = []
 *             self._logger = logger
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_1__init__, 0, __pyx_n_s_Future___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__173);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 899, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":904
 *             self._lock = threading.Lock()
 * 
 *         def _set_nothreads(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Like set(), but assuming no threading is involved. It won't wake waiting threads,
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_3_set_nothreads, 0, __pyx_n_s_Future__set_nothreads, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults7), 3)) __PYX_ERR(0, 904, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_3)->__pyx_arg_hasattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
      __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_3)->__pyx_arg_tuple = ((PyObject *)(&PyTuple_Type));
      __Pyx_GIVEREF((&PyTuple_Type));
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_20__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_set_nothreads, __pyx_t_3) < 0) __PYX_ERR(0, 904, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":930
 *                         error("Error in async callback", exc_info = True)
 * 
 *         def set(self, value, hasattr = hasattr, tuple = tuple, getattr = getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Set the future's result as either a value, an exception wrappedn in ExceptionWrapper, or
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_5set, 0, __pyx_n_s_Future_set, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults8), 3)) __PYX_ERR(0, 930, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_3)->__pyx_arg_hasattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
      __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_3)->__pyx_arg_tuple = ((PyObject *)(&PyTuple_Type));
      __Pyx_GIVEREF((&PyTuple_Type));
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_22__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_set, __pyx_t_3) < 0) __PYX_ERR(0, 930, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":961
 *                 event.set()
 * 
 *         set_result = set             # <<<<<<<<<<<<<<
 * 
 *         def miss(self):
 */
      __pyx_t_3 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_set);
      if (unlikely(!__pyx_t_3)) {
        PyErr_Clear();
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set);
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_set_result, __pyx_t_3) < 0) __PYX_ERR(0, 961, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":963
 *         set_result = set
 * 
 *         def miss(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_7miss, 0, __pyx_n_s_Future_miss, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_miss, __pyx_t_3) < 0) __PYX_ERR(0, 963, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":969
 *             self.set(CacheMissError)
 * 
 *         def _miss_nothreads(self):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting a cache miss result without thread safety.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_9_miss_nothreads, 0, __pyx_n_s_Future__miss_nothreads, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_miss_nothreads, __pyx_t_3) < 0) __PYX_ERR(0, 969, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":976
 *             self._set_nothreads(CacheMissError)
 * 
 *         def exc(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_11exc, 0, __pyx_n_s_Future_exc, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_exc, __pyx_t_3) < 0) __PYX_ERR(0, 976, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":983
 *             self.set(ExceptionWrapper(exc_info))
 * 
 *         def _exc_nothreads(self, exc_info):             # <<<<<<<<<<<<<<
 *             """
 *             Shorthand for setting an exception result from an exc_info tuple
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_13_exc_nothreads, 0, __pyx_n_s_Future__exc_nothreads, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_exc_nothreads, __pyx_t_3) < 0) __PYX_ERR(0, 983, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":991
 *             self._set_nothreads(ExceptionWrapper(exc_info))
 * 
 *         def set_exception(self, exception):             # <<<<<<<<<<<<<<
 *             """
 *             Set the Future's exception object.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_15set_exception, 0, __pyx_n_s_Future_set_exception, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 991, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_set_exception, __pyx_t_3) < 0) __PYX_ERR(0, 991, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":997
 *             self.exc((type(exception),exception,None))
 * 
 *         def on_value(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When and if the operation completes without exception, the callback
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_17on_value, 0, __pyx_n_s_Future_on_value, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_value, __pyx_t_3) < 0) __PYX_ERR(0, 997, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1007
 *             return self._on_stuff(value_callback)
 * 
 *         def on_miss(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in a cache miss, the callback will be invoked
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_19on_miss, 0, __pyx_n_s_Future_on_miss, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1007, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_miss, __pyx_t_3) < 0) __PYX_ERR(0, 1007, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1017
 *             return self._on_stuff(miss_callback)
 * 
 *         def on_exc(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation results in an exception, the callback will be invoked
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_21on_exc, 0, __pyx_n_s_Future_on_exc, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_exc, __pyx_t_3) < 0) __PYX_ERR(0, 1017, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1027
 *             return self._on_stuff(exc_callback)
 * 
 *         def on_any(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Handy method to set callbacks for all kinds of results, and it's actually
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_23on_any, 0, __pyx_n_s_Future_on_any, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__196);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_any, __pyx_t_3) < 0) __PYX_ERR(0, 1027, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1044
 *             return self._on_stuff(callback)
 * 
 *         def on_any_once(self, on_value = None, on_miss = None, on_exc = None):             # <<<<<<<<<<<<<<
 *             """
 *             Like on_any, but will only set the callback if no other callback has been set
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_25on_any_once, 0, __pyx_n_s_Future_on_any_once, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__199);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_any_once, __pyx_t_3) < 0) __PYX_ERR(0, 1044, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1051
 *                 self.on_any(on_value, on_miss, on_exc)
 * 
 *         def on_done(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operation is done, the callback will be invoked without arguments,
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_27on_done, 0, __pyx_n_s_Future_on_done, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_done, __pyx_t_3) < 0) __PYX_ERR(0, 1051, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1060
 *             return self._on_stuff(done_callback)
 * 
 *         def chain(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_29chain, 0, __pyx_n_s_Future_chain, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_chain, __pyx_t_3) < 0) __PYX_ERR(0, 1060, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1066
 *             self._on_stuff(defer.set)
 * 
 *         def chain_std(self, defer):             # <<<<<<<<<<<<<<
 *             """
 *             Invoke all the callbacks of the other defer, without assuming the other
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_31chain_std, 0, __pyx_n_s_Future_chain_std, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_chain_std, __pyx_t_3) < 0) __PYX_ERR(0, 1066, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1077
 *             )
 * 
 *         def _on_stuff(self, callback, hasattr=hasattr):             # <<<<<<<<<<<<<<
 *             cbap = self._cb.append
 *             docall = hasattr(self, '_value')
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_33_on_stuff, 0, __pyx_n_s_Future__on_stuff, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1077, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 1)) __PYX_ERR(0, 1077, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_3)->__pyx_arg_hasattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_24__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_on_stuff, __pyx_t_3) < 0) __PYX_ERR(0, 1077, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1089
 *             return self
 * 
 *         def add_done_callback(self, callback):             # <<<<<<<<<<<<<<
 *             """
 *             When the operatio is done, the callback will be invoked with the
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_35add_done_callback, 0, __pyx_n_s_Future_add_done_callback, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_add_done_callback, __pyx_t_3) < 0) __PYX_ERR(0, 1089, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1101
 *             return self._on_stuff(weak_callback)
 * 
 *         def done(self, hasattr=hasattr, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has finished, in a result or exception or cancelled, and False if not.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_37done, 0, __pyx_n_s_Future_done, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1101, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 2)) __PYX_ERR(0, 1101, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_hasattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_26__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_done, __pyx_t_3) < 0) __PYX_ERR(0, 1101, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1107
 *             return hasattr(self, '_value') or getattr(self, '_cancelled', False)
 * 
 *         def running(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation is running and cannot be cancelled. False if not running
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_39running, 0, __pyx_n_s_Future_running, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1107, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults11), 1)) __PYX_ERR(0, 1107, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_28__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_running_2, __pyx_t_3) < 0) __PYX_ERR(0, 1107, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1114
 *             return getattr(self, '_running', False)
 * 
 *         def cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if the operation has been cancelled successfully.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_41cancelled, 0, __pyx_n_s_Future_cancelled, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults12), 1)) __PYX_ERR(0, 1114, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_30__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_cancelled_2, __pyx_t_3) < 0) __PYX_ERR(0, 1114, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1120
 *             return getattr(self, '_cancelled', False)
 * 
 *         def cancel_pending(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Return True if cancel was called.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_43cancel_pending, 0, __pyx_n_s_Future_cancel_pending, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults13), 1)) __PYX_ERR(0, 1120, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_32__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_cancel_pending_2, __pyx_t_3) < 0) __PYX_ERR(0, 1120, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1126
 *             return getattr(self, '_cancel_pending', False)
 * 
 *         def cancel(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             Request cancelling of the operation. If the operation cannot be cancelled,
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_45cancel, 0, __pyx_n_s_Future_cancel, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults14), 1)) __PYX_ERR(0, 1126, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_34__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_cancel, __pyx_t_3) < 0) __PYX_ERR(0, 1126, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1137
 *                 return True
 * 
 *         def set_running_or_notify_cancelled(self, getattr=getattr):             # <<<<<<<<<<<<<<
 *             """
 *             To be invoked by executors before executing the operation. If it returns True,
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_47set_running_or_notify_cancelled, 0, __pyx_n_s_Future_set_running_or_notify_can, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults15), 1)) __PYX_ERR(0, 1137, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_36__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_set_running_or_notify_cancelled, __pyx_t_3) < 0) __PYX_ERR(0, 1137, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1156
 *                 return True
 * 
 *         def result(self, timeout=None, hasattr=hasattr, getattr=getattr, isinstance=isinstance, norecurse=False):             # <<<<<<<<<<<<<<
 *             """
 *             Return the operation's result, if any. If an exception was the result, re-raise it.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_49result, 0, __pyx_n_s_Future_result, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults16), 3)) __PYX_ERR(0, 1156, __pyx_L4_except_error)
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_hasattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_3)->__pyx_arg_hasattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_3)->__pyx_arg_getattr = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s_isinstance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_3)->__pyx_arg_isinstance = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6chorde_7clients_5async_38__defaults__);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_result, __pyx_t_3) < 0) __PYX_ERR(0, 1156, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":1195
 *                         raise TimeoutError
 * 
 *         def exception(self, timeout=None):             # <<<<<<<<<<<<<<
 *             """
 *             If the operation resulted in an exception, return the exception object.
 */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_6Future_51exception, 0, __pyx_n_s_Future_exception, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__226);
      if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_exception, __pyx_t_3) < 0) __PYX_ERR(0, 1195, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "chorde/clients/async.py":893
 *             raise exc[0], exc[1], exc[2]
 * 
 *     class Future(object):  # lint:ok             # <<<<<<<<<<<<<<
 *         __slots__ = (
 *             '_cb', '_value', '_logger', '_running', '_cancel_pending', '_cancelled', '_done_event',
 */
      __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_Future, __pyx_tuple__169, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 893, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Future, __pyx_t_3) < 0) __PYX_ERR(0, 893, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;
    __pyx_L4_except_error:;

    /* "chorde/clients/async.py":873
 *         return str(self)
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from ._async import ExceptionWrapper, Future
 * except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L7_try_end:;
  }

  /* "chorde/clients/async.py":1222
 * 
 * 
 * def makeFutureWrapper(base):             # <<<<<<<<<<<<<<
 *     """
 *     Nice utility function to create Future wrappers. If using a library
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_5makeFutureWrapper, 0, __pyx_n_s_makeFutureWrapper, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_makeFutureWrapper, __pyx_t_6) < 0) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "chorde/clients/async.py":1244
 *     return WrapperFuture
 * 
 * class AsyncCacheProcessorThreadPool(ThreadPool):             # <<<<<<<<<<<<<<
 *     class AsyncCacheProcessorThread(ThreadPool.Process):
 *         pass
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_7, __pyx_n_s_AsyncCacheProcessorThreadPool, __pyx_n_s_AsyncCacheProcessorThreadPool, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1245
 * 
 * class AsyncCacheProcessorThreadPool(ThreadPool):
 *     class AsyncCacheProcessorThread(ThreadPool.Process):             # <<<<<<<<<<<<<<
 *         pass
 *     Process = AsyncCacheProcessorThread
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ThreadPool); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Process); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_AsyncCacheProcessorThread, __pyx_n_s_AsyncCacheProcessorThreadPool_As, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_AsyncCacheProcessorThread, __pyx_t_4, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_AsyncCacheProcessorThread, __pyx_t_2) < 0) __PYX_ERR(0, 1245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1247
 *     class AsyncCacheProcessorThread(ThreadPool.Process):
 *         pass
 *     Process = AsyncCacheProcessorThread             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, workers):
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_AsyncCacheProcessorThread);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_AsyncCacheProcessorThread);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_Process, __pyx_t_4) < 0) __PYX_ERR(0, 1247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1249
 *     Process = AsyncCacheProcessorThread
 * 
 *     def __init__(self, workers):             # <<<<<<<<<<<<<<
 *         if ThreadPool is multiprocessing.pool.ThreadPool:
 *             # This patches ThreadPool, which is broken when instanced
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_29AsyncCacheProcessorThreadPool_1__init__, 0, __pyx_n_s_AsyncCacheProcessorThreadPool_2, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1244
 *     return WrapperFuture
 * 
 * class AsyncCacheProcessorThreadPool(ThreadPool):             # <<<<<<<<<<<<<<
 *     class AsyncCacheProcessorThread(ThreadPool.Process):
 *         pass
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_AsyncCacheProcessorThreadPool, __pyx_t_7, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncCacheProcessorThreadPool, __pyx_t_4) < 0) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":1258
 *         ThreadPool.__init__(self, workers)
 * 
 * class ProcessorStats(object):             # <<<<<<<<<<<<<<
 *     __slots__ = (
 *         'tasks_queued',
 */
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__231); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__231, __pyx_n_s_ProcessorStats, __pyx_n_s_ProcessorStats, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":1260
 * class ProcessorStats(object):
 *     __slots__ = (
 *         'tasks_queued',             # <<<<<<<<<<<<<<
 *         'tasks_started',
 *         'tasks_cancelled',
 */
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_slots, __pyx_tuple__232) < 0) __PYX_ERR(0, 1259, __pyx_L1_error)

  /* "chorde/clients/async.py":1271
 *         'task_time_max',
 *     )
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.reset()
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_14ProcessorStats_1__init__, 0, __pyx_n_s_ProcessorStats___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1274
 *         self.reset()
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued = self.tasks_started = self.tasks_cancelled = self.tasks_completed = 0
 *         self.wait_time_sum = self.task_time_sum = 0
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_14ProcessorStats_3reset, 0, __pyx_n_s_ProcessorStats_reset, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_reset, __pyx_t_8) < 0) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1279
 *         self.wait_time_min = self.wait_time_max = self.task_time_min = self.task_time_max = None
 * 
 *     def on_task_queued(self):             # <<<<<<<<<<<<<<
 *         self.tasks_queued += 1
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_14ProcessorStats_5on_task_queued, 0, __pyx_n_s_ProcessorStats_on_task_queued, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_on_task_queued, __pyx_t_8) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1282
 *         self.tasks_queued += 1
 * 
 *     def on_task_cancelled(self):             # <<<<<<<<<<<<<<
 *         self.tasks_cancelled += 1
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_14ProcessorStats_7on_task_cancelled, 0, __pyx_n_s_ProcessorStats_on_task_cancelled, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_on_task_cancelled, __pyx_t_8) < 0) __PYX_ERR(0, 1282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1285
 *         self.tasks_cancelled += 1
 * 
 *     def on_task_started(self, wait_time):             # <<<<<<<<<<<<<<
 *         self.tasks_started += 1
 *         self.wait_time_sum += wait_time
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_14ProcessorStats_9on_task_started, 0, __pyx_n_s_ProcessorStats_on_task_started, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_on_task_started, __pyx_t_8) < 0) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1295
 *             self.wait_time_max = wait_time
 * 
 *     def on_task_completed(self, task_time):             # <<<<<<<<<<<<<<
 *         self.tasks_completed += 1
 *         self.task_time_sum += task_time
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_14ProcessorStats_11on_task_completed, 0, __pyx_n_s_ProcessorStats_on_task_completed, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_on_task_completed, __pyx_t_8) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1258
 *         ThreadPool.__init__(self, workers)
 * 
 * class ProcessorStats(object):             # <<<<<<<<<<<<<<
 *     __slots__ = (
 *         'tasks_queued',
 */
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ProcessorStats, __pyx_tuple__231, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProcessorStats, __pyx_t_8) < 0) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":1305
 *             self.task_time_max = task_time
 * 
 * class AsyncCacheProcessor(object):             # <<<<<<<<<<<<<<
 *     """
 *     An async cache processor will allow asynchronous reads
 */
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__245); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__245, __pyx_n_s_AsyncCacheProcessor, __pyx_n_s_AsyncCacheProcessor, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, __pyx_kp_s_An_async_cache_processor_will_a); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":1326
 *     """
 * 
 *     def __init__(self, workers, client,             # <<<<<<<<<<<<<<
 *             coalescence_buffer_size = 500, maxqueue = None, cleanup_cycles = 500,
 *             threadpool = None):
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_1__init__, 0, __pyx_n_s_AsyncCacheProcessor___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__248);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1355
 * 
 *     @property
 *     def threadpool(self):             # <<<<<<<<<<<<<<
 *         if self._threadpool is None:
 *             with self._spawnlock:
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_3threadpool, 0, __pyx_n_s_AsyncCacheProcessor_threadpool, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1354
 *         self.stats = ProcessorStats()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def threadpool(self):
 *         if self._threadpool is None:
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_threadpool, __pyx_t_4) < 0) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1365
 *         return self._threadpool
 * 
 *     def _enqueue(self, action, coalesce = None, coalesce_key = NONE):             # <<<<<<<<<<<<<<
 *         logger = self.logger
 *         cfuture = future = Future(logger)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_5_enqueue, 0, __pyx_n_s_AsyncCacheProcessor__enqueue, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults17), 1)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_t_4)->__pyx_arg_coalesce_key = __pyx_t_8;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_6chorde_7clients_5async_40__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_enqueue, __pyx_t_4) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1468
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_7capacity, 0, __pyx_n_s_AsyncCacheProcessor_capacity, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1467
 *         return cfuture
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def capacity(self):
 *         return self.client.capacity
 */
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_capacity, __pyx_t_8) < 0) __PYX_ERR(0, 1468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1472
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_9usage, 0, __pyx_n_s_AsyncCacheProcessor_usage, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1471
 *         return self.client.capacity
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def usage(self):
 *         return self.client.usage
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_usage, __pyx_t_4) < 0) __PYX_ERR(0, 1472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1476
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_11queuelen, 0, __pyx_n_s_AsyncCacheProcessor_queuelen, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1475
 *         return self.client.usage
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def queuelen(self):
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 */
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_queuelen, __pyx_t_8) < 0) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1479
 *         return self._threadpool._taskqueue.qsize() if self._threadpool is not None else 0
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_13do_async, 0, __pyx_n_s_AsyncCacheProcessor_do_async, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_do_async, __pyx_t_8) < 0) __PYX_ERR(0, 1479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1482
 *         return self._enqueue(functools.partial(func, *args, **kwargs))
 * 
 *     def do_async_coalescent(self, coalesce, coalesce_key, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an already-queued future if there is one, or a new one if not.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_15do_async_coalescent, 0, __pyx_n_s_AsyncCacheProcessor_do_async_coa, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_do_async_coalescent, __pyx_t_8) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1495
 *             coalesce, coalesce_key)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a proxy of this processor bound to the specified client instead.
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_17bound, 0, __pyx_n_s_AsyncCacheProcessor_bound, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_bound, __pyx_t_8) < 0) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1501
 *         return WrappedCacheProcessor(self, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_19getTtl, 0, __pyx_n_s_AsyncCacheProcessor_getTtl, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults18), 1)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_t_8)->__pyx_arg_default = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_6chorde_7clients_5async_42__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getTtl, __pyx_t_8) < 0) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1512
 *             self.coalesce_getTtl, ckey)
 * 
 *     def get(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw or not (kw.viewkeys() - COALESCE_IGNORE_KWARGS):
 *             if default is NONE:
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_21get, 0, __pyx_n_s_AsyncCacheProcessor_get, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults19), 1)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_t_8)->__pyx_arg_default = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_6chorde_7clients_5async_44__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_get, __pyx_t_8) < 0) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1523
 *             self.coalesce_get, ckey)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_23contains, 0, __pyx_n_s_AsyncCacheProcessor_contains, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_contains_3, __pyx_t_8) < 0) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1533
 *             self.coalesce_contains, ckey)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_25put, 0, __pyx_n_s_AsyncCacheProcessor_put, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_put, __pyx_t_8) < 0) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1536
 *         return self._enqueue(functools.partial(self.client.put, key, value, ttl, **kw))
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_27renew, 0, __pyx_n_s_AsyncCacheProcessor_renew, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_renew, __pyx_t_8) < 0) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1539
 *         return self._enqueue(functools.partial(self.client.renew, key, ttl, **kw))
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_29add, 0, __pyx_n_s_AsyncCacheProcessor_add, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_add, __pyx_t_8) < 0) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1542
 *         return self._enqueue(functools.partial(self.client.add, key, value, ttl, **kw))
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_31delete, 0, __pyx_n_s_AsyncCacheProcessor_delete, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_delete, __pyx_t_8) < 0) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1545
 *         return self._enqueue(functools.partial(self.client.delete, key))
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_33expire, 0, __pyx_n_s_AsyncCacheProcessor_expire, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_expire, __pyx_t_8) < 0) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1548
 *         return self._enqueue(functools.partial(self.client.expire, key))
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.clear)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_35clear, 0, __pyx_n_s_AsyncCacheProcessor_clear, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_clear, __pyx_t_8) < 0) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1551
 *         return self._enqueue(self.client.clear)
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         return self._enqueue(self.client.purge)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_37purge, 0, __pyx_n_s_AsyncCacheProcessor_purge, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_purge, __pyx_t_8) < 0) __PYX_ERR(0, 1551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1554
 *         return self._enqueue(self.client.purge)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_39register_cleanup, 0, __pyx_n_s_AsyncCacheProcessor_register_cle, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_register_cleanup, __pyx_t_8) < 0) __PYX_ERR(0, 1554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1563
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         """
 *         Register a callable that will take no arguments, and will
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_19AsyncCacheProcessor_41register_default_cleanup, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_AsyncCacheProcessor_register_def, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1562
 *         self.cleanup_tasks.append(task)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def register_default_cleanup(task):
 *         """
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_register_default_cleanup, __pyx_t_4) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1305
 *             self.task_time_max = task_time
 * 
 * class AsyncCacheProcessor(object):             # <<<<<<<<<<<<<<
 *     """
 *     An async cache processor will allow asynchronous reads
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_AsyncCacheProcessor, __pyx_tuple__245, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncCacheProcessor, __pyx_t_4) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":1572
 *         _global_cleanup_tasks.append(task)
 * 
 * class WrappedCacheProcessor(object):             # <<<<<<<<<<<<<<
 *     """
 *     Wraps an AsyncCacheProcessor, binding its interface to a
 */
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__289); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__289, __pyx_n_s_WrappedCacheProcessor, __pyx_n_s_WrappedCacheProcessor, (PyObject *) NULL, __pyx_n_s_chorde_clients_async, __pyx_kp_s_Wraps_an_AsyncCacheProcessor_bi); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "chorde/clients/async.py":1577
 *     different client.
 *     """
 *     def __init__(self, processor, client, coalescence_buffer_size = 500):             # <<<<<<<<<<<<<<
 *         self.processor = processor
 *         self.client = client
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_1__init__, 0, __pyx_n_s_WrappedCacheProcessor___init, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__292);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1585
 * 
 *     @property
 *     def capacity(self):             # <<<<<<<<<<<<<<
 *         return self.client.capacity
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_3capacity, 0, __pyx_n_s_WrappedCacheProcessor_capacity, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1584
 *         self.coalesce_contains = Cache(coalescence_buffer_size)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def capacity(self):
 *         return self.client.capacity
 */
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_capacity, __pyx_t_8) < 0) __PYX_ERR(0, 1585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1589
 * 
 *     @property
 *     def usage(self):             # <<<<<<<<<<<<<<
 *         return self.client.usage
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_5usage, 0, __pyx_n_s_WrappedCacheProcessor_usage, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__296)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1588
 *         return self.client.capacity
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def usage(self):
 *         return self.client.usage
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_usage, __pyx_t_4) < 0) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1593
 * 
 *     @property
 *     def queuelen(self):             # <<<<<<<<<<<<<<
 *         return self.processor.queuelen
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_7queuelen, 0, __pyx_n_s_WrappedCacheProcessor_queuelen, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1592
 *         return self.client.usage
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def queuelen(self):
 *         return self.processor.queuelen
 */
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_queuelen, __pyx_t_8) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1597
 * 
 *     @property
 *     def maxqueue(self):             # <<<<<<<<<<<<<<
 *         return self.processor.maxqueue
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_9maxqueue, 0, __pyx_n_s_WrappedCacheProcessor_maxqueue, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1596
 *         return self.processor.queuelen
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def maxqueue(self):
 *         return self.processor.maxqueue
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_maxqueue, __pyx_t_4) < 0) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1601
 * 
 *     @property
 *     def stats(self):             # <<<<<<<<<<<<<<
 *         return self.processor.stats
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_11stats, 0, __pyx_n_s_WrappedCacheProcessor_stats, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__302)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "chorde/clients/async.py":1600
 *         return self.processor.maxqueue
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stats(self):
 *         return self.processor.stats
 */
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_stats, __pyx_t_8) < 0) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1604
 *         return self.processor.stats
 * 
 *     def do_async(self, func, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_13do_async, 0, __pyx_n_s_WrappedCacheProcessor_do_async, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__304)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_do_async, __pyx_t_8) < 0) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1607
 *         return self.processor.do_async(func, *args, **kwargs)
 * 
 *     def bound(self, client):             # <<<<<<<<<<<<<<
 *         if client is self.client:
 *             return self
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_15bound, 0, __pyx_n_s_WrappedCacheProcessor_bound, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__306)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_bound, __pyx_t_8) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1613
 *             return WrappedCacheProcessor(self.processor, client)
 * 
 *     def getTtl(self, key, default = NONE, **kw):             # <<<<<<<<<<<<<<
 *         if not kw:
 *             if default is NONE:
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_17getTtl, 0, __pyx_n_s_WrappedCacheProcessor_getTtl, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults20), 1)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_t_8)->__pyx_arg_default = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_6chorde_7clients_5async_46__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getTtl, __pyx_t_8) < 0) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1624
 *             self.client.getTtl, key, default, **kw)
 * 
 *     def get(self, key, default = NONE):             # <<<<<<<<<<<<<<
 *         if default is NONE:
 *             ckey = key
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_19get, 0, __pyx_n_s_WrappedCacheProcessor_get, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults21), 1)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NONE_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_t_8)->__pyx_arg_default = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_6chorde_7clients_5async_48__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_get, __pyx_t_8) < 0) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1632
 *             self.client.get, key, default)
 * 
 *     def contains(self, key, *p, **kw):             # <<<<<<<<<<<<<<
 *         if not p and not kw:
 *             ckey = key
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_21contains, 0, __pyx_n_s_WrappedCacheProcessor_contains, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_contains_3, __pyx_t_8) < 0) __PYX_ERR(0, 1632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1642
 *             self.client.contains, key, *p, **kw)
 * 
 *     def put(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_23put, 0, __pyx_n_s_WrappedCacheProcessor_put, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_put, __pyx_t_8) < 0) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1645
 *         return self.processor.do_async(self.client.put, key, value, ttl, **kw)
 * 
 *     def renew(self, key, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_25renew, 0, __pyx_n_s_WrappedCacheProcessor_renew, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_renew, __pyx_t_8) < 0) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1648
 *         return self.processor.do_async(self.client.renew, key, ttl, **kw)
 * 
 *     def add(self, key, value, ttl, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_27add, 0, __pyx_n_s_WrappedCacheProcessor_add, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_add, __pyx_t_8) < 0) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1651
 *         return self.processor.do_async(self.client.add, key, value, ttl, **kw)
 * 
 *     def delete(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.delete, key)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_29delete, 0, __pyx_n_s_WrappedCacheProcessor_delete, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_delete, __pyx_t_8) < 0) __PYX_ERR(0, 1651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1654
 *         return self.processor.do_async(self.client.delete, key)
 * 
 *     def expire(self, key):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.expire, key)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_31expire, 0, __pyx_n_s_WrappedCacheProcessor_expire, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_expire, __pyx_t_8) < 0) __PYX_ERR(0, 1654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1657
 *         return self.processor.do_async(self.client.expire, key)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.clear)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_33clear, 0, __pyx_n_s_WrappedCacheProcessor_clear, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_clear, __pyx_t_8) < 0) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1660
 *         return self.processor.do_async(self.client.clear)
 * 
 *     def purge(self, *p, **kw):             # <<<<<<<<<<<<<<
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_35purge, 0, __pyx_n_s_WrappedCacheProcessor_purge, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_purge, __pyx_t_8) < 0) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1663
 *         return self.processor.do_async(self.client.purge, *p, **kw)
 * 
 *     def register_cleanup(self, task):             # <<<<<<<<<<<<<<
 *         self.processor.register_cleanup(task)
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_37register_cleanup, 0, __pyx_n_s_WrappedCacheProcessor_register_c, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_register_cleanup, __pyx_t_8) < 0) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "chorde/clients/async.py":1667
 * 
 *     @staticmethod
 *     def register_default_cleanup(task):             # <<<<<<<<<<<<<<
 *         AsyncCacheProcessor.register_default_cleanup(task)
 */
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6chorde_7clients_5async_21WrappedCacheProcessor_39register_default_cleanup, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_WrappedCacheProcessor_register_d, NULL, __pyx_n_s_chorde_clients_async, __pyx_d, ((PyObject *)__pyx_codeobj__330)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "chorde/clients/async.py":1666
 *         self.processor.register_cleanup(task)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def register_default_cleanup(task):
 *         AsyncCacheProcessor.register_default_cleanup(task)
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_register_default_cleanup, __pyx_t_4) < 0) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "chorde/clients/async.py":1572
 *         _global_cleanup_tasks.append(task)
 * 
 * class WrappedCacheProcessor(object):             # <<<<<<<<<<<<<<
 *     """
 *     Wraps an AsyncCacheProcessor, binding its interface to a
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_WrappedCacheProcessor, __pyx_tuple__289, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WrappedCacheProcessor, __pyx_t_4) < 0) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "chorde/clients/async.py":1
 * from chorde.serialize import serialize             # <<<<<<<<<<<<<<
 * 
 * import logging
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init chorde.clients.async", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init chorde.clients.async");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* MergeKeywords */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* SliceObject */
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* CallUnboundCMethod0 */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_viewkeys */
static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewKeys(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d);
    else
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_viewkeys, d);
}

/* pyfrozenset_new */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* py_dict_items */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
            _PyGen_SetStopIterationValue(result);
        }
        Py_CLEAR(result);
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (Py_REFCNT(self) > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
