Support for execution forks (concurrent request execution) by request execution interceptors
This commit is contained in:
parent
26bb4b6b9c
commit
1c73280983
|
@ -33,7 +33,7 @@ import org.apache.hc.core5.concurrent.Cancellable;
|
|||
* This interface represents an object that can be made aware of
|
||||
* long running, potentially blocking processes.
|
||||
*
|
||||
* @since 5.0
|
||||
* TODO: replace with CancellableDependency from HttpCore 5.0b2
|
||||
*/
|
||||
public interface CancellableAware {
|
||||
|
||||
|
|
|
@ -80,4 +80,6 @@ public interface AsyncExecRuntime {
|
|||
|
||||
void markConnectionNonReusable();
|
||||
|
||||
AsyncExecRuntime fork();
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ package org.apache.hc.client5.http.classic;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.hc.client5.http.CancellableAware;
|
||||
import org.apache.hc.client5.http.HttpRoute;
|
||||
import org.apache.hc.client5.http.protocol.HttpClientContext;
|
||||
import org.apache.hc.core5.annotation.Internal;
|
||||
|
@ -84,4 +85,6 @@ public interface ExecRuntime {
|
|||
|
||||
void setConnectionValidFor(TimeValue duration);
|
||||
|
||||
ExecRuntime fork(CancellableAware cancellableAware);
|
||||
|
||||
}
|
||||
|
|
|
@ -249,4 +249,9 @@ class InternalHttp2AsyncExecRuntime implements AsyncExecRuntime {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncExecRuntime fork() {
|
||||
return new InternalHttp2AsyncExecRuntime(log, connPool);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -281,4 +281,9 @@ class InternalHttpAsyncExecRuntime implements AsyncExecRuntime {
|
|||
validDuration = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncExecRuntime fork() {
|
||||
return new InternalHttpAsyncExecRuntime(log, manager, connectionInitiator, versionPolicy);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -255,4 +255,9 @@ class InternalExecRuntime implements ExecRuntime, Cancellable {
|
|||
return !alreadyReleased;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecRuntime fork(final CancellableAware cancellableAware) {
|
||||
return new InternalExecRuntime(log, manager, requestExecutor, cancellableAware);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue