/// <inheritdoc/>
 public Task <Try <UncommittedAggregateEvents> > TryConverge(EmbeddingCurrentState current, ProjectionState desired, ExecutionContext executionContext, CancellationToken cancellationToken)
 => DoWork(
     current,
     newCurrent => _stateComparer.TryCheckEquality(newCurrent.State, desired),
     (newCurrent, token) => _embedding.TryCompare(newCurrent, desired, executionContext, token),
     executionContext,
     cancellationToken);
    /// <inheritdoc/>
    public Try <bool> TryCheckForProjectionStateLoop(ProjectionState currentState, IEnumerable <ProjectionState> previousStates)
    {
        var equalityResults = previousStates.AsParallel()
                              .Select(previousState => _comparer.TryCheckEquality(previousState, currentState))
                              // The query execution is deferred so need to call for ToList here
                              // https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/introduction-to-plinq#the-forall-operator
                              .ToList();
        var failure = equalityResults.FirstOrDefault(_ => !_.Success);

        if (failure is not null)
        {
            return(failure.Exception);
        }
        return(equalityResults.Any(_ => _.Result));
    }