自动化立体仓库 - WCS系统
野心家
2025-04-01 66942458f7753fe4ddee7c5ed3386d61cff28b24
src/main/java/com/zy/core/cache/MessageQueue.java
@@ -150,5 +150,20 @@
                break;
        }
    }
    public static boolean offer(SlaveType type, Integer devpId, Task task, Runnable callback) {
        boolean result = offer(type, devpId, task); // 先执行原有任务逻辑
        if (result && callback != null) {
            new Thread(() -> {
                try {
                    Thread.sleep(200); // 模拟任务执行时间
                    callback.run();
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                }
            }).start();
        }
        return result;
    }
}