本文整理汇总了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);
}
示例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();
}
};
}
示例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();
}
};
}
示例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();
}
};
}