Commit 8ab4d274 by guo_minglei@163.com

调度中心添加杀死工作流和杀死任务的API接口修改

parent 83c0c40b
package com.test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: gml
* @create: 2020-01-15 17:28
*/
public class Test2 {
public static void main(String[] args) throws IOException, InterruptedException {
List<Process> processList = new ArrayList<>();
Thread thread = new Thread(() -> {
Runtime runtime = Runtime.getRuntime();
try {
Process exec = runtime.exec("python D:\\workspace\\pycharmWorkSpace\\test\\com.test\\Test.py");
processList.add(exec);
BufferedReader br = new BufferedReader(new InputStreamReader(exec.getInputStream()));
String res = null;
while ((res = br.readLine()) != null){
System.out.println(res);
}
} catch (IOException e) {
e.printStackTrace();
}
});
thread.start();
Thread.sleep(12000);
processList.forEach(process -> {
process.destroy();
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment