optimize: 优化自定义线程池.

pull/161/head
chen.ma 3 years ago
parent ac65dac6f1
commit aa19960582

@ -1,7 +1,7 @@
package io.dynamic.threadpool.starter.core;
import io.dynamic.threadpool.common.model.PoolRunStateInfo;
import io.dynamic.threadpool.starter.wrap.CustomThreadPoolExecutor;
import io.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor;
import io.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap;
import java.net.InetAddress;

@ -0,0 +1,51 @@
package io.dynamic.threadpool.starter.core.registry;
/**
* Discovery Client.
*
* @author chen.ma
* @date 2021/7/13 21:51
*/
public class DiscoveryClient {
private InstanceInfo instanceInfo;
/**
*
*/
private void initScheduledTasks() {
}
/**
*
*
* @return
*/
boolean register() {
return true;
}
/**
* Server
*/
public class HeartbeatThread implements Runnable {
@Override
public void run() {
}
}
/**
*
*
* @return
*/
boolean renew() {
return true;
}
}

@ -0,0 +1,10 @@
package io.dynamic.threadpool.starter.core.registry;
/**
* Dynamic Tp Client.
*
* @author chen.ma
* @date 2021/7/13 21:50
*/
public interface DynamicTpClient {
}

@ -0,0 +1,12 @@
package io.dynamic.threadpool.starter.core.registry;
/**
* Instance Info.
*
* @author chen.ma
* @date 2021/7/13 22:10
*/
public class InstanceInfo {
private String appName;
}

@ -13,7 +13,7 @@ import java.util.Map;
public interface HttpAgent {
/**
* NacosIp
*
*/
void start();

@ -1,7 +1,6 @@
package io.dynamic.threadpool.starter.toolkit.thread;
import io.dynamic.threadpool.common.toolkit.Assert;
import io.dynamic.threadpool.starter.wrap.CustomThreadPoolExecutor;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
@ -158,4 +157,4 @@ public class AbstractBuildThreadPoolTemplate {
.build();
}
}
}
}

@ -1,4 +1,4 @@
package io.dynamic.threadpool.starter.wrap;
package io.dynamic.threadpool.starter.toolkit.thread;
import lombok.Getter;
@ -19,7 +19,7 @@ import java.util.concurrent.locks.ReentrantLock;
* @date 2021/7/8 21:47
*/
@Getter
public final class CustomThreadPoolExecutor extends ThreadPoolExecutor {
public final class CustomThreadPoolExecutor extends ThreadPoolExecutorTemplate {
private final AtomicInteger regectCount = new AtomicInteger();
private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0));
Loading…
Cancel
Save