本文整理匯總了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();
}
};
}