|
|
@ -15,19 +15,28 @@ |
|
|
|
*/ |
|
|
|
package com.corundumstudio.socketio.scheduler; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.ThreadFactory; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
import io.netty.channel.ChannelHandlerContext; |
|
|
|
import io.netty.util.HashedWheelTimer; |
|
|
|
import io.netty.util.Timeout; |
|
|
|
import io.netty.util.TimerTask; |
|
|
|
import io.netty.util.internal.PlatformDependent; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
public class HashedWheelScheduler implements CancelableScheduler { |
|
|
|
|
|
|
|
private final Map<SchedulerKey, Timeout> scheduledFutures = PlatformDependent.newConcurrentHashMap(); |
|
|
|
private final HashedWheelTimer executorService = new HashedWheelTimer(); |
|
|
|
private final HashedWheelTimer executorService; |
|
|
|
|
|
|
|
public HashedWheelScheduler() { |
|
|
|
executorService = new HashedWheelTimer(); |
|
|
|
} |
|
|
|
|
|
|
|
public HashedWheelScheduler(ThreadFactory threadFactory) { |
|
|
|
executorService = new HashedWheelTimer(threadFactory); |
|
|
|
} |
|
|
|
|
|
|
|
private volatile ChannelHandlerContext ctx; |
|
|
|
|
|
|
|