

def close(self, callback=None):
    'Close uv handle\n\n        :type callback: Callable(uv_handle: Handle) or None\n        '
    if self._close_called:
        return
    if callback:

        def cb_wrapper(uv_handle_t):
            callback(self)
            alive.remove(self)
            self._ffi_cb = None
            self._ffi_close_cb = None
    else:
        cb_wrapper = functools.partial(default_close_cb, handle=self)
    self._ffi_close_cb = ffi.callback('void (*)(uv_handle_t *)', cb_wrapper)
    libuv.uv_close(self.uv_handle, self._ffi_close_cb)
    self._close_called = True

dataset/ETHPy150Open veegee/guv/pyuv_cffi/__init__.py Handle.close/original