com.google.common.util.concurrent.AbstractFuture.clearListeners()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(35)

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

AbstractFuture.clearListeners介绍

[英]Clears the #listeners list and returns the most recently added value.
[中]清除#侦听器列表并返回最近添加的值。

代码示例

代码示例来源:origin: google/guava

next = future.clearListeners(next);
future = null;
while (next != null) {

代码示例来源:origin: google/j2objc

next = future.clearListeners(next);
future = null;
while (next != null) {

代码示例来源:origin: wildfly/wildfly

next = future.clearListeners(next);
future = null;
while (next != null) {

代码示例来源:origin: com.diffplug.guava/guava-concurrent

/** Unblocks all threads and runs all listeners. */
private void complete() {
  for (Waiter currentWaiter = clearWaiters(); currentWaiter != null; currentWaiter = currentWaiter.next) {
    currentWaiter.unpark();
  }
  // We need to reverse the list to handle buggy listeners that depend on ordering.
  Listener currentListener = clearListeners();
  Listener reversedList = null;
  while (currentListener != null) {
    Listener tmp = currentListener;
    currentListener = currentListener.next;
    tmp.next = reversedList;
    reversedList = tmp;
  }
  for (; reversedList != null; reversedList = reversedList.next) {
    executeListener(reversedList.task, reversedList.executor);
  }
  // We call this after the listeners on the theory that done() will only be used for 'cleanup'
  // oriented tasks (e.g. clearing fields) and so can wait behind listeners which may be executing
  // more important work.  A counter argument would be that done() is trusted code and therefore
  // it would be safe to run before potentially slow or poorly behaved listeners.  Reevaluate this
  // once we have more examples of done() implementations.
  done();
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

next = future.clearListeners(next);
future = null;
while (next != null) {

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

next = future.clearListeners(next);
future = null;
while (next != null) {

相关文章