當前位置: 首頁>>代碼示例>>Java>>正文


Java Func0.call方法代碼示例

本文整理匯總了Java中rx.functions.Func0.call方法的典型用法代碼示例。如果您正苦於以下問題:Java Func0.call方法的具體用法?Java Func0.call怎麽用?Java Func0.call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rx.functions.Func0的用法示例。


在下文中一共展示了Func0.call方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: create

import rx.functions.Func0; //導入方法依賴的package包/類
static <T> ConnectableObservable<T> create(Observable<? extends T> source, final Func0<? extends ReplayBuffer<T>> bufferFactory) {
    final AtomicReference<ReplaySubscriber<T>> curr = new AtomicReference();
    return new OperatorReplay(new Observable$OnSubscribe<T>() {
        public void call(Subscriber<? super T> child) {
            ReplaySubscriber<T> r;
            ReplaySubscriber<T> u;
            do {
                r = (ReplaySubscriber) curr.get();
                if (r != null) {
                    break;
                }
                u = new ReplaySubscriber(curr, (ReplayBuffer) bufferFactory.call());
                u.init();
            } while (!curr.compareAndSet(r, u));
            r = u;
            InnerProducer<T> inner = new InnerProducer(r, child);
            r.add(inner);
            child.add(inner);
            child.setProducer(inner);
        }
    }, source, curr, bufferFactory);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:OperatorReplay.java

示例2: getRequestValuesGaugeMonitor

import rx.functions.Func0; //導入方法依賴的package包/類
/**
 * Get the total requests and failed requests for instance level.
 *
 * @param metricsName Name of the metrics
 * @param metricToEvaluate observable method to be called for preparation of metrics.
 * @return Guage metrics
 */
protected Monitor<Number> getRequestValuesGaugeMonitor(final String metricsName,
    final Func0<Number> metricToEvaluate) {
  return new GaugeMetric(MonitorConfig.builder(metricsName).build()) {

    @Override
    public Number getValue() {
      return metricToEvaluate.call();
    }
  };
}
 
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:18,代碼來源:MetricsServoRegistry.java

示例3: getInfoMetricsOperationalAndInstance

import rx.functions.Func0; //導入方法依賴的package包/類
/**
 * Get the total requests and failed requests for each producer.
 *
 * @param name Name of the metrics
 * @param metricToEvaluate observable method to be called for preparation of metrics.
 * @return Guage metrics
 */
protected Monitor<String> getInfoMetricsOperationalAndInstance(final String name,
    final Func0<String> metricToEvaluate) {
  return new InformationalMetric(MonitorConfig.builder(name).build()) {
    @Override
    public String getValue() {
      return metricToEvaluate.call();
    }
  };
}
 
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:17,代碼來源:MetricsServoRegistry.java

示例4: getInfoMetricsOperationLevel

import rx.functions.Func0; //導入方法依賴的package包/類
/**
 * Get the total requests and failed requests for each producer.
 *
 * @param metricsName  Name of the metrics
 * @param metricToEvaluate observable method to be called for preparation of metrics.
 * @return Guage metrics
 */
protected Monitor<String> getInfoMetricsOperationLevel(final String metricsName,
    final Func0<String> metricToEvaluate) {
  return new InformationalMetric(MonitorConfig.builder(metricsName).build()) {
    @Override
    public String getValue() {
      return metricToEvaluate.call();
    }
  };
}
 
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:17,代碼來源:MetricsServoRegistry.java


注:本文中的rx.functions.Func0.call方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。