公共 静态 TaskDispatcher createBatchingTaskDispatcher (串ID, INT MAXBUFFERSIZE, INT workloadSize, INT workerCount, 长maxBatchingDelay, 长congestionRetryDelayMs, 长networkFailureRetryMs, TaskProcessor taskProcessor) { final AcceptorExecutor acceptorExecutor = new AcceptorExecutor( id、maxBufferSize、workloadSize、maxBatchingDelay、congestionRetryDelayMs、networkFailureRetryMs ); final TaskExecutors taskExecutor = TaskExecutors.batchExecutors(id, workerCount, taskProcessor, acceptorExecutor); return new TaskDispatcher() { @Override public void process (ID id, T task, long expiryTime) { acceptorExecutor.process(id, task, expiryTime); } @Override public void shutdown () { acceptorExecutor.shutdown(); taskExecutor.shutdown(); } }; }