同步操作将从 京东零售/asyncTool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package seq;import com.jd.platform.async.executor.Async;import com.jd.platform.async.executor.timer.SystemClock;import com.jd.platform.async.wrapper.WorkerWrapper;import java.util.concurrent.ExecutionException;/*** 串行测试* @author wuweifeng wrote on 2019年11月20日.*/@SuppressWarnings("Duplicates")public class TestSequentialTimeout {public static void main(String[] args) throws InterruptedException, ExecutionException {testFirstTimeout();}/*** begin-1576719450476* callback worker0 failure--1576719451338----worker0--default-threadName:main* callback worker1 failure--1576719451338----worker1--default-threadName:main* callback worker2 failure--1576719451338----worker2--default-threadName:main* end-1576719451338* cost-862*/private static void testFirstTimeout() throws ExecutionException, InterruptedException {SeqWorker1 w1 = new SeqWorker1();SeqWorker2 w2 = new SeqWorker2();SeqTimeoutWorker t = new SeqTimeoutWorker();WorkerWrapper<String, String> workerWrapper2 = new WorkerWrapper.Builder<String, String>().worker(w2).callback(w2).param("2").build();WorkerWrapper<String, String> workerWrapper1 = new WorkerWrapper.Builder<String, String>().worker(w1).callback(w1).param("1").next(workerWrapper2).build();//2在1后面串行//T会超时WorkerWrapper<String, String> workerWrapperT = new WorkerWrapper.Builder<String, String>().worker(t).callback(t).param("t").next(workerWrapper1).build();long now = SystemClock.now();System.out.println("begin-" + now);Async.beginWork(5000, workerWrapperT);System.out.println("end-" + SystemClock.now());System.err.println("cost-" + (SystemClock.now() - now));Async.shutDown();}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。