ClientFuture
This commit is contained in:
@@ -66,12 +66,12 @@ public abstract class ClientConnection<R extends ClientRequest, P extends Client
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected final AtomicBoolean pauseWriting = new AtomicBoolean();
|
final AtomicBoolean pauseWriting = new AtomicBoolean();
|
||||||
|
|
||||||
final ConcurrentLinkedQueue<ClientFuture> pauseRequests = new ConcurrentLinkedQueue<>();
|
final ConcurrentLinkedQueue<ClientFuture> pauseRequests = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
// pauseWriting=true,此字段才会有值; pauseWriting=false,此字段值为null
|
// pauseWriting=true,此字段才会有值; pauseWriting=false,此字段值为null
|
||||||
protected ClientFuture currHalfWriteFuture;
|
ClientFuture currHalfWriteFuture;
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private Client.AddressConnEntry connEntry;
|
private Client.AddressConnEntry connEntry;
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import org.redkale.util.Traces;
|
|||||||
*/
|
*/
|
||||||
public class ClientFuture<R extends ClientRequest, T> extends CompletableFuture<T> implements Runnable {
|
public class ClientFuture<R extends ClientRequest, T> extends CompletableFuture<T> implements Runnable {
|
||||||
|
|
||||||
|
public static final ClientFuture NIL = new ClientFuture() {};
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
protected final R request;
|
protected final R request;
|
||||||
|
|
||||||
@@ -27,6 +29,12 @@ public class ClientFuture<R extends ClientRequest, T> extends CompletableFuture<
|
|||||||
|
|
||||||
private ScheduledFuture timeout;
|
private ScheduledFuture timeout;
|
||||||
|
|
||||||
|
private ClientFuture() {
|
||||||
|
super();
|
||||||
|
this.conn = null;
|
||||||
|
this.request = null;
|
||||||
|
}
|
||||||
|
|
||||||
ClientFuture(ClientConnection conn, R request) {
|
ClientFuture(ClientConnection conn, R request) {
|
||||||
super();
|
super();
|
||||||
Objects.requireNonNull(conn);
|
Objects.requireNonNull(conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user