Vert.x :Thread Thread[worker-pool-0,5,main] has been blocked for 129 ms, time limit is 0 ms

10月 12, 2020 9:29:51 上午 io.vertx.core.impl.BlockedThreadChecker
警告: Thread Thread[worker-pool-0,5,main] has been blocked for 129 ms, time limit is 0 ms

注意:创建线程池时时间单位默认纳秒。 

  /**
   * Like {@link #createSharedWorkerExecutor(String, int, long, TimeUnit)} but with the {@link TimeUnit#NANOSECONDS ns unit}.
   */
  WorkerExecutor createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime);

可以用:

  /**
   * Create a named worker executor, the executor should be closed when it's not needed anymore to release
   * resources.<p/>
   *
   * This method can be called mutiple times with the same {@code name}. Executors with the same name will share
   * the same worker pool. The worker pool size , max execute time and unit of max execute time are set when the worker pool is created and
   * won't change after.<p>
   *
   * The worker pool is released when all the {@link WorkerExecutor} sharing the same name are closed.
   *
   * @param name the name of the worker executor
   * @param poolSize the size of the pool
   * @param maxExecuteTime the value of max worker execute time
   * @param maxExecuteTimeUnit the value of unit of max worker execute time
   * @return the named worker executor
   */
  WorkerExecutor createSharedWorkerExecutor(String name, int poolSize, long maxExecuteTime, TimeUnit maxExecuteTimeUnit);

猜你喜欢

转载自blog.csdn.net/haoranhaoshi/article/details/109021593
ms