当前位置: 首页>>代码示例>>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;未经允许,请勿转载。