reactor.core.publisher.WorkQueueProcessor.bestEffortMaxSubscribers()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中reactor.core.publisher.WorkQueueProcessor.bestEffortMaxSubscribers()方法的一些代码示例,展示了WorkQueueProcessor.bestEffortMaxSubscribers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkQueueProcessor.bestEffortMaxSubscribers()方法的具体详情如下:
包路径:reactor.core.publisher.WorkQueueProcessor
类名称:WorkQueueProcessor
方法名:bestEffortMaxSubscribers

WorkQueueProcessor.bestEffortMaxSubscribers介绍

[英]This method will attempt to compute the maximum amount of subscribers a WorkQueueProcessor can accommodate based on a given ExecutorService.

It can only accurately detect this for ThreadPoolExecutor and ForkJoinPool instances, and will return Integer#MIN_VALUE for other executor implementations.
[中]此方法将尝试根据给定的ExecutorService计算WorkQueueProcessor可以容纳的最大订阅者数量。
对于ThreadPoolExecutor和ForkJoinPool实例,它只能准确地检测到这一点,对于其他executor实现,它将返回整数#MIN_值。

代码示例

代码示例来源:origin: reactor/reactor-core

  1. Executors.unconfigurableScheduledExecutorService(executorService5);
  2. int maxSub1 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService1);
  3. int maxSub2 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService2);
  4. int maxSub3 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService3);
  5. int maxSub4 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService4);
  6. int maxSub5 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService5);
  7. int maxSub6 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService6);
  8. int maxSub7 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService7);
  9. int maxSub8 = WorkQueueProcessor.bestEffortMaxSubscribers(executorService8);

代码示例来源:origin: reactor/reactor-core

  1. int maxSubscribers = bestEffortMaxSubscribers(executor);
  2. if (maxSubscribers > Integer.MIN_VALUE && subscriberCount > maxSubscribers) {
  3. throw new IllegalStateException("The executor service could not accommodate" +

代码示例来源:origin: io.projectreactor/reactor-core

  1. int maxSubscribers = bestEffortMaxSubscribers(executor);
  2. if (maxSubscribers > Integer.MIN_VALUE && subscriberCount > maxSubscribers) {
  3. throw new IllegalStateException("The executor service could not accommodate" +

相关文章