@@ -0,0 +1,2166 @@
+// Copyright 2017 The Bazel Authors. All rights reserved.%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//    http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0Apackage com.google.devtools.build.skyframe;%0A%0Aimport com.google.common.base.Supplier;%0Aimport com.google.common.collect.ImmutableList;%0A%0A/**%0A * An %7B@link EvaluationProgressReceiver%7D that delegates to a bunch of other%0A * %7B@link EvaluationProgressReceiver%7Ds.%0A */%0Apublic class CompoundEvaluationProgressReceiver implements EvaluationProgressReceiver %7B%0A  protected final ImmutableList%3C? extends EvaluationProgressReceiver%3E receivers;%0A%0A  protected CompoundEvaluationProgressReceiver(%0A      ImmutableList%3C? extends EvaluationProgressReceiver%3E receivers) %7B%0A    this.receivers = receivers;%0A  %7D%0A%0A  public static EvaluationProgressReceiver of(EvaluationProgressReceiver... receivers) %7B%0A    return new CompoundEvaluationProgressReceiver(ImmutableList.copyOf(receivers));%0A  %7D%0A%0A  @Override%0A  public void invalidated(SkyKey skyKey, InvalidationState state) %7B%0A    for (EvaluationProgressReceiver receiver : receivers) %7B%0A      receiver.invalidated(skyKey, state);%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void enqueueing(SkyKey skyKey) %7B%0A    for (EvaluationProgressReceiver receiver : receivers) %7B%0A      receiver.enqueueing(skyKey);%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void computed(SkyKey skyKey, long elapsedTimeNanos) %7B%0A    for (EvaluationProgressReceiver receiver : receivers) %7B%0A      receiver.computed(skyKey, elapsedTimeNanos);%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void evaluated(SkyKey skyKey, Supplier%3CSkyValue%3E valueSupplier, EvaluationState state) %7B%0A    for (EvaluationProgressReceiver receiver : receivers) %7B%0A      receiver.evaluated(skyKey, valueSupplier, state);%0A    %7D%0A  %7D%0A%7D%0A

Introduce CompoundEvaluationProgressReceiver for combining multiple EvaluationProgressReceivers.