scala.concurrent.Promise.completeWith()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(197)

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

Promise.completeWith介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.controller/sal-distributed-datastore

@Override
  public void invoke(TransactionContext transactionContext) {
    promise.completeWith(getDirectCommitFuture(transactionContext, operationCallbackRef));
  }
});

代码示例来源:origin: org.opendaylight.controller/sal-distributed-datastore

@Override
  public void onComplete(final Throwable failure, final Iterable<Object> notUsed) {
    LOG.debug("Tx: {} - prior read-only Tx futures complete", txId);
    // Complete the returned Promise with the original Future.
    returnPromise.completeWith(future);
  }
};

代码示例来源:origin: org.opendaylight.controller/sal-distributed-datastore

@Override
  public void invoke(TransactionContext transactionContext) {
    promise.completeWith(transactionContext.readyTransaction());
  }
});

代码示例来源:origin: org.opendaylight.controller/sal-distributed-datastore

@Override
  public void onComplete(final Throwable failure, final Object notUsed) {
    if (failure != null) {
      // A Ready Future failed so fail the returned Promise.
      LOG.error("Tx: {} - ready future failed for previous Tx {}", txId, previousTransactionId);
      returnPromise.failure(failure);
    } else {
      LOG.debug("Tx: {} - previous Tx {} readied - proceeding to FindPrimaryShard",
          txId, previousTransactionId);
      // Send the FindPrimaryShard message and use the resulting Future to complete the
      // returned Promise.
      returnPromise.completeWith(parent.findPrimaryShard(shardName, txId));
    }
  }
};

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

pending.serializedKeyAndNamespace);
pending.promise.completeWith(resultFuture);

代码示例来源:origin: org.opendaylight.netconf/netconf-topology

private void registerProvidedSourcesToSchemaRegistry() {
  Future<Set<SourceIdentifier>> sourcesFuture = remoteYangTextSourceProvider.getProvidedSources();
  resolvedSourcesPromise.completeWith(sourcesFuture);
  final RemoteSchemaProvider remoteProvider = new RemoteSchemaProvider(remoteYangTextSourceProvider, actorSystem.dispatcher());
  sourcesFuture.onComplete(new OnComplete<Set<SourceIdentifier>>() {
    @Override
    public void onComplete(Throwable throwable, Set<SourceIdentifier> sourceIdentifiers) throws Throwable {
      for (SourceIdentifier sourceId : sourceIdentifiers) {
        sourceRegistrations.add(schemaRegistry.registerSchemaSource(remoteProvider,
            PotentialSchemaSource.create(sourceId, YangTextSchemaSource.class, PotentialSchemaSource.Costs.REMOTE_IO.getValue())));
      }
    }
  }, actorSystem.dispatcher());
}

相关文章