Skip to content

Commit

Permalink
Fix Cluster Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperxpro committed Nov 24, 2024
1 parent 2b4adde commit c2c892c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
MAVEN_OPTS: -Dio.netty.tryReflectionSetAccessible=true

jobs:
JDK17:
JDK21:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ public void backlogQueue(ConcurrentLinkedQueue<Object> newQueue) {
* Close this {@link Connection}
*/
public synchronized void close() {
// If Backlog Queue contains something then clear it before closing connection.
// If Backlog Queue contains something, then clear it before closing the connection.
if (backlogQueue != null && !backlogQueue.isEmpty()) {
clearBacklog();
}

// Remove this connection from Node
node.removeConnection(this);

// If Channel is not null then close it.
// If Channel is not null, then close it.
// Channel can be null if the connection is not initialized.
if (channel != null) {
channel.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ private GlobalExecutors() {
}

/**
* Submit a new {@link Runnable} task to executed
* Submit a new {@link Runnable} task to execute
*
* @param runnable {@link Runnable} to be executed
* @return {@link CompletableFuture} Instance of task to be executed
* @return {@link CompletableFuture} Instance of a task to be executed
*/
public static CompletableFuture<Void> submitTask(Runnable runnable) {
return CompletableFuture.runAsync(runnable, EXECUTOR_SERVICE);
Expand All @@ -66,9 +66,9 @@ public static CompletableFuture<Void> submitTask(Runnable runnable) {
/**
* Submit a new task to be executed
*
* @param supplier {@link Supplier} implementing task to be executed
* @param supplier {@link Supplier} implementing a task to be executed
* @param <T> Class implementing {@link Supplier}
* @return {@link CompletableFuture} Instance of task to be executed
* @return {@link CompletableFuture} Instance of a task to be executed
*/
public static <T> CompletableFuture<T> submitTask(Supplier<T> supplier) {
return CompletableFuture.supplyAsync(supplier, EXECUTOR_SERVICE);
Expand All @@ -78,7 +78,7 @@ public static <T> CompletableFuture<T> submitTask(Supplier<T> supplier) {
* Submit and schedule a new {@link Runnable} task to be executed with a fixed delay
*
* @param runnable {@link Runnable} to be executed
* @return {@link CompletableFuture} Instance of task to be executed
* @return {@link CompletableFuture} Instance of a task to be executed
*/
public static ScheduledFuture<?> submitTaskAndRunEvery(Runnable runnable, int initialDelay, int period, TimeUnit timeUnit) {
return SCHEDULED_EXECUTOR_SERVICE.scheduleWithFixedDelay(runnable, initialDelay, period, timeUnit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

/**
* {@linkplain ConnectionTimeoutHandler} is a {@linkplain ChannelDuplexHandler} that is used to handle Connection Timeout.
* <p>
* This Handler is used to handle Connection Timeout for both Upstream and Downstream Connections.
* </p>
*/
public final class ConnectionTimeoutHandler extends ChannelDuplexHandler implements Runnable {

/**
* Enum to represent the State of Connection Timeout
*/
public enum State {

/**
* When Upstream Read(Receiving) is Idle
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE;

public final class CompressionUtil {

private static final boolean EnableBrotli = true;
private static final boolean EnableGzip = true;
private static final boolean EnableDeflate = true;
Expand Down

0 comments on commit c2c892c

Please sign in to comment.