本文整理了Java中com.google.common.util.concurrent.AbstractFuture.clearListeners()
方法的一些代码示例,展示了AbstractFuture.clearListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractFuture.clearListeners()
方法的具体详情如下:
包路径:com.google.common.util.concurrent.AbstractFuture
类名称: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) {
内容来源于网络,如有侵权,请联系作者删除!