Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mizosoft committed Apr 27, 2024
1 parent 64c3c3b commit e77b44d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Moataz Abdelnasser
* Copyright (c) 2024 Moataz Abdelnasser
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -27,12 +27,12 @@
import com.github.mizosoft.methanol.internal.concurrent.SerialExecutor;
import java.util.concurrent.Flow.Subscription;

/** A forwarding subscriber that ensures signals aren't called concurrently. */
public abstract class SerializedSubscriber<T> extends ForwardingSubscriber<T> {
/** A forwarding subscriber that ensures the delegate isn't called concurrently. */
public abstract class SerializedForwardingSubscriber<T> extends ForwardingSubscriber<T> {
private final SerialExecutor serialExecutor = new SerialExecutor(FlowSupport.SYNC_EXECUTOR);
private boolean done; // Visibility piggybacks on SerialExecutor's synchronization.

protected SerializedSubscriber() {}
protected SerializedForwardingSubscriber() {}

@Override
public void onSubscribe(Subscription subscription) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Moataz Abdelnasser
* Copyright (c) 2024 Moataz Abdelnasser
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -42,7 +42,7 @@
* requested item isn't received within a timeout.
*/
public abstract class TimeoutSubscriber<T, S extends Subscriber<? super T>>
extends SerializedSubscriber<T> {
extends SerializedForwardingSubscriber<T> {
private static final Future<Void> COMPLETED_FUTURE = CompletableFuture.completedFuture(null);

private static final VarHandle DEMAND;
Expand Down

0 comments on commit e77b44d

Please sign in to comment.