Skip to content

Commit

Permalink
Make CompoundEvaluationProgressReceiver's ctor public.
Browse files Browse the repository at this point in the history
    RELNOTES: None
    PiperOrigin-RevId: 250772007
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent 5cef022 commit 450fd26
Showing 1 changed file with 6 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,16 @@
// limitations under the License.
package com.google.devtools.build.skyframe;

import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;

/**
* An {@link EvaluationProgressReceiver} that delegates to a bunch of other
* {@link EvaluationProgressReceiver}s.
* An {@link EvaluationProgressReceiver} that delegates to a bunch of other {@link
* EvaluationProgressReceiver}s.
*/
public class CompoundEvaluationProgressReceiver implements EvaluationProgressReceiver {
protected final ImmutableList<? extends EvaluationProgressReceiver> receivers;

protected CompoundEvaluationProgressReceiver(
public final class CompoundEvaluationProgressReceiver
extends CompoundEvaluationProgressReceiverBase {
public CompoundEvaluationProgressReceiver(
ImmutableList<? extends EvaluationProgressReceiver> receivers) {
this.receivers = receivers;
}

public static EvaluationProgressReceiver of(EvaluationProgressReceiver... receivers) {
return new CompoundEvaluationProgressReceiver(ImmutableList.copyOf(receivers));
}

@Override
public void invalidated(SkyKey skyKey, InvalidationState state) {
for (EvaluationProgressReceiver receiver : receivers) {
receiver.invalidated(skyKey, state);
}
}

@Override
public void enqueueing(SkyKey skyKey) {
for (EvaluationProgressReceiver receiver : receivers) {
receiver.enqueueing(skyKey);
}
}

@Override
public void computed(SkyKey skyKey, long elapsedTimeNanos) {
for (EvaluationProgressReceiver receiver : receivers) {
receiver.computed(skyKey, elapsedTimeNanos);
}
}

@Override
public void evaluated(SkyKey skyKey, Supplier<SkyValue> valueSupplier, EvaluationState state) {
for (EvaluationProgressReceiver receiver : receivers) {
receiver.evaluated(skyKey, valueSupplier, state);
}
super(receivers);
}
}

0 comments on commit 450fd26

Please sign in to comment.