If we have a pipeline, shared in thread, or in the good thread, return it
        else use the direct connection

def _connection(self):
        """
        If we have a pipeline, shared in thread, or in the good thread, return it
        else use the direct connection
        """
        if self._pipelined_connection is not None:
            if self._pipelined_connection.share_in_threads or \
                    threading.current_thread().ident == self._pipelined_connection.current_thread_id:
                return self._pipelined_connection


        return self._direct_connection