| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.command; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  | import java.util.concurrent.CompletableFuture; | 
|---|
|  |  |  | import java.util.concurrent.ConcurrentHashMap; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @Author: liurunyu | 
|---|
|  |  |  | * @Date: 2025/5/6 16:33 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class ComResultWait { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //ConcurrentHashMap是线程安全的 | 
|---|
|  |  |  | private static final Map<Long, CompletableFuture> features = new ConcurrentHashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void put(Long key, CompletableFuture value) { | 
|---|
|  |  |  | features.put(key, value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public static CompletableFuture get(Long key) { | 
|---|
|  |  |  | return features.get(key); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static boolean contain(Long key) { | 
|---|
|  |  |  | return features.containsKey(key); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void remove(Long key){ | 
|---|
|  |  |  | features.remove(key) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|