|
@@ -1,3 +1,19 @@
|
|
|
|
+/*
|
|
|
|
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
|
|
|
|
+ *
|
|
|
|
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
|
|
|
|
+ * you may not use this file except in compliance with the License.
|
|
|
|
+ * You may obtain a copy of the License at
|
|
|
|
+ *
|
|
|
|
+ * https://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
+ *
|
|
|
|
+ * Unless required by applicable law or agreed to in writing, software
|
|
|
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
+ * See the License for the specific language governing permissions and
|
|
|
|
+ * limitations under the License.
|
|
|
|
+ */
|
|
|
|
+
|
|
package cn.tycoding.langchat.common.task;
|
|
package cn.tycoding.langchat.common.task;
|
|
|
|
|
|
import cn.tycoding.langchat.common.threadpool.AnalysisThreadPool;
|
|
import cn.tycoding.langchat.common.threadpool.AnalysisThreadPool;
|
|
@@ -12,7 +28,6 @@ import java.util.concurrent.Future;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author GB
|
|
* @author GB
|
|
- * @desc
|
|
|
|
* @since 2024-08-22
|
|
* @since 2024-08-22
|
|
*/
|
|
*/
|
|
public class TaskManager {
|
|
public class TaskManager {
|
|
@@ -20,9 +35,6 @@ public class TaskManager {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 提交任务
|
|
* 提交任务
|
|
- *
|
|
|
|
- * @param id
|
|
|
|
- * @param function
|
|
|
|
*/
|
|
*/
|
|
public static void submitTask(String id, Callable<?> function) {
|
|
public static void submitTask(String id, Callable<?> function) {
|
|
Future<?> future = AnalysisThreadPool.getThreadPool().submit(function);
|
|
Future<?> future = AnalysisThreadPool.getThreadPool().submit(function);
|
|
@@ -33,9 +45,6 @@ public class TaskManager {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 弹出任务
|
|
* 弹出任务
|
|
- *
|
|
|
|
- * @param id
|
|
|
|
- * @return
|
|
|
|
*/
|
|
*/
|
|
public void popTaskResult(String id) {
|
|
public void popTaskResult(String id) {
|
|
TASK_MAP.remove(id);
|
|
TASK_MAP.remove(id);
|