protected function wrapCallback(callable $callback)
    {
        return function ($response, $connection, $command) use ($callback) {
            if ($command && !$response instanceof ResponseInterface) {
                $response = $command->parseResponse($response);
            }

            \call_user_func($callback, $response, $this, $command);
        };
    }