From c42614978ff12013a1eabebd0289b27169a5784f Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 06 五月 2025 17:25:56 +0800
Subject: [PATCH] 1、实现万功能token(0000-0000-1234-9876-5); 2、web端单独实现命令结果等待器,并相应修改相关部分; 3、web端实现透传命令; 4、修改一些不当注释; 5、优化一些代码。

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java |  157 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 157 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java
new file mode 100644
index 0000000..37eec13
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java
@@ -0,0 +1,157 @@
+package com.dy.common.threadPool;
+
+
+public class Test {
+
+//
+//	public static void main(String args[])throws Exception {
+////		Test t = new Test();
+////		t.testShort1();
+////		t.testShort2();
+////		t.testLong();
+//	}
+
+	/**
+	 * 娴嬭瘯澧炲姞绾跨▼绾跨▼  
+	 * @throws Exception 
+	 *
+	 */
+	@SuppressWarnings("unused")
+	private void testShort1() throws Exception {
+		TreadPoolFactory.initThreadPoolShort("娴嬭瘯绾跨▼缁�",	2, 1, 10, 20);
+		ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolShort() ;
+		try {
+			int n = 1 ;
+			Thread.sleep(1000);
+			while (n < 4) {
+				System.out.println("鍔犲叆鐭伐浣滀换鍔�(" + n + ")");
+				pool.putJob(new ThreadPool.Job() {
+					public void execute() {
+						System.out.println("!!!!!寮�濮嬬煭宸ヤ綔" + this.hashCode());
+						try {
+							Thread.sleep(2000);
+						} catch (Exception e) {
+							;
+						}
+						System.out.println("!!!!!缁撴潫鐭伐浣�" + this.hashCode());
+					}
+					@Override
+					public void destroy(){
+					}
+					@Override
+					public boolean isDestroy(){
+						return false ;
+					}
+				});
+				n++ ;
+				Thread.sleep(100);
+			}
+		} catch (Exception e) {
+
+		}
+	}
+	/**
+	 * 娴嬭瘯澧炲姞绾跨▼绾跨▼  
+	 * @throws Exception 
+	 *
+	 */
+	@SuppressWarnings("unused")
+	private void testShort2() throws Exception {
+		TreadPoolFactory.initThreadPoolShort("娴嬭瘯鐭伐浣滅嚎绋嬬粍", 2, 1, 5, 6);
+		ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolShort() ;
+		try {
+			int n = 1 ;
+			Thread.sleep(1000);
+			while (n < 2) {
+				System.out.println("鍔犲叆鐭伐浣滀换鍔�(" + n + ")");
+				pool.putJob(new ThreadPool.Job() {
+					@Override
+					public void execute() {
+						Long times = 0L ;
+						System.out.println("!!!!!寮�濮嬬煭宸ヤ綔" + this.hashCode());
+						while(true){
+							if(this.isDestroy == null || !this.isDestroy.booleanValue()){
+								times++ ;
+								System.out.println("!!!!!鎵ц鐭伐浣�" + this.hashCode() + " 娆℃暟锛�" + times);
+								try {
+									Thread.sleep(2000);
+								} catch (Exception e) {
+									;
+								}
+//								System.out.println("!!!!!缁撴潫闀垮伐浣�" + this.hashCode());
+							}
+						}
+					}
+					@Override
+					public void destroy(){
+						this.isDestroy = true ;
+					}
+					@Override
+					public boolean isDestroy(){
+						if(this.isDestroy == null){
+							return false ;
+						}
+						return this.isDestroy.booleanValue() ;
+					}
+					private Boolean isDestroy;
+				});
+				n++ ;
+				Thread.sleep(100);
+			}
+		} catch (Exception e) {
+
+		}
+	}/**
+	 * 娴嬭瘯澧炲姞绾跨▼绾跨▼  
+	 * @throws Exception 
+	 *
+	 */
+	@SuppressWarnings("unused")
+	private void testLong() throws Exception {
+		TreadPoolFactory.initThreadPoolLong("娴嬭瘯闀垮伐浣滅嚎绋嬬粍", -1, 1, 5, -1);
+		ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolLong() ;
+		try {
+			int n = 1 ;
+			Thread.sleep(1000);
+			while (n < 2) {
+				System.out.println("鍔犲叆闀垮伐浣滀换鍔�(" + n + ")");
+				pool.putJob(new ThreadPool.Job() {
+					@Override
+					public void execute() {
+						Long times = 0L ;
+						System.out.println("!!!!!寮�濮嬮暱宸ヤ綔" + this.hashCode());
+						while(true){
+							if(this.isDestroy == null || !this.isDestroy.booleanValue()){
+								times++ ;
+								System.out.println("!!!!!鎵ц闀垮伐浣�" + this.hashCode() + " 娆℃暟锛�" + times);
+								try {
+									Thread.sleep(2000);
+								} catch (Exception e) {
+									;
+								}
+//								System.out.println("!!!!!缁撴潫闀垮伐浣�" + this.hashCode());
+							}
+						}
+					}
+					@Override
+					public void destroy(){
+						this.isDestroy = true ;
+					}
+					@Override
+					public boolean isDestroy(){
+						if(this.isDestroy == null){
+							return false ;
+						}
+						return this.isDestroy.booleanValue() ;
+					}
+					private Boolean isDestroy;
+				});
+				n++ ;
+				Thread.sleep(100);
+			}
+		} catch (Exception e) {
+
+		}
+	}
+
+}

--
Gitblit v1.8.0