def finish_operation(self, conn_or_internal_id, success, *args):
        """Finish an operation on a connection.

        Args:
            conn_or_internal_id (string, int): Either an integer connection id or a string
                internal_id
            success (bool): Whether the operation was successful
            failure_reason (string): Optional reason why the operation failed
            result (dict): Optional dictionary containing the results of the operation
        """

        data = {
            'id': conn_or_internal_id,
            'success': success,
            'callback_args': args
        }

        action = ConnectionAction('finish_operation', data, sync=False)
        self._actions.put(action)
Finish an operation on a connection.

        Args:
            conn_or_internal_id (string, int): Either an integer connection id or a string
                internal_id
            success (bool): Whether the operation was successful
            failure_reason (string): Optional reason why the operation failed
            result (dict): Optional dictionary containing the results of the operation