This action will force synchronization from 京东零售/asyncTool, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
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日.*/public class TestSequential {public static void main(String[] args) throws InterruptedException, ExecutionException {SeqWorker w = new SeqWorker();SeqWorker1 w1 = new SeqWorker1();SeqWorker2 w2 = new SeqWorker2();//顺序0-1-2WorkerWrapper<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();WorkerWrapper<String, String> workerWrapper = new WorkerWrapper.Builder<String, String>().worker(w).callback(w).param("0").next(workerWrapper1).build();// testNormal(workerWrapper);testGroupTimeout(workerWrapper);}private static void testNormal(WorkerWrapper<String, String> workerWrapper) throws ExecutionException, InterruptedException {long now = SystemClock.now();System.out.println("begin-" + now);Async.beginWork(3500, workerWrapper);System.out.println("end-" + SystemClock.now());System.err.println("cost-" + (SystemClock.now() - now));Async.shutDown();}private static void testGroupTimeout(WorkerWrapper<String, String> workerWrapper) throws ExecutionException, InterruptedException {long now = SystemClock.now();System.out.println("begin-" + now);Async.beginWork(2500, workerWrapper);System.out.println("end-" + SystemClock.now());System.err.println("cost-" + (SystemClock.now() - now));Async.shutDown();}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。