def upsert_subscriber(self, subscriber, update_method):
    """Add or update a subscriber.

    :param self: type, the class instance whose subscriber list will be updated.
    :param subscriber: any, the subscriber to add or update.
    :param update_method: callable, the method or function to call using when publishing the new value.
    :return: str, 'subscriber updated' or 'subscriber added'
    """
    for sub_num, subr in enumerate(self._length_subscribers):
        if subr['subscriber'] is subscriber:
            self._length_subscribers[sub_num] = {'subscriber': subscriber, 'update_method': update_method}
            return 'subscriber updated'
    self._length_subscribers.append({'subscriber': subscriber, 'update_method': update_method})
    return 'subscriber added'