def METHOD_NAME(self, new_value: T) -> None:
    # No need to block as we can't change from resolved to unresolved.
    if self.resolved:
        raise RuntimeError("cannot set the value of an already resolved promise")
    with self.mutex:
        self.resolved = True
        self.value = new_value
        for callback in self.callbacks:
            callback(new_value)