io.reactivex.rxjava3.core.SingleObserver源码实例Demo

类io.reactivex.rxjava3.core.SingleObserver源码实例Demo

下面列出了io.reactivex.rxjava3.core.SingleObserver 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: resilience4j   文件: SingleCircuitBreaker.java
@Override
protected void subscribeActual(SingleObserver<? super T> downstream) {
    if (circuitBreaker.tryAcquirePermission()) {
        upstream.subscribe(new CircuitBreakerSingleObserver(downstream));
    } else {
        downstream.onSubscribe(EmptyDisposable.INSTANCE);
        downstream.onError(createCallNotPermittedException(circuitBreaker));
    }
}
 
源代码2 项目: resilience4j   文件: SingleBulkhead.java
@Override
protected void subscribeActual(SingleObserver<? super T> downstream) {
    if (bulkhead.tryAcquirePermission()) {
        upstream.subscribe(new BulkheadSingleObserver(downstream));
    } else {
        downstream.onSubscribe(EmptyDisposable.INSTANCE);
        downstream.onError(BulkheadFullException.createBulkheadFullException(bulkhead));
    }
}
 
源代码3 项目: resilience4j   文件: SingleRateLimiter.java
@Override
protected void subscribeActual(SingleObserver<? super T> downstream) {
    long waitDuration = rateLimiter.reservePermission();
    if (waitDuration >= 0) {
        if (waitDuration > 0) {
            Completable.timer(waitDuration, TimeUnit.NANOSECONDS)
                .subscribe(() -> upstream.subscribe(new RateLimiterSingleObserver(downstream)));
        } else {
            upstream.subscribe(new RateLimiterSingleObserver(downstream));
        }
    } else {
        downstream.onSubscribe(EmptyDisposable.INSTANCE);
        downstream.onError(RequestNotPermitted.createRequestNotPermitted(rateLimiter));
    }
}
 
源代码4 项目: resilience4j   文件: SingleCircuitBreaker.java
CircuitBreakerSingleObserver(SingleObserver<? super T> downstreamObserver) {
    super(downstreamObserver);
    this.start = System.nanoTime();
}
 
源代码5 项目: resilience4j   文件: SingleBulkhead.java
BulkheadSingleObserver(SingleObserver<? super T> downstreamObserver) {
    super(downstreamObserver);
}
 
源代码6 项目: resilience4j   文件: AbstractSingleObserver.java
public AbstractSingleObserver(SingleObserver<? super T> downstreamObserver) {
    this.downstreamObserver = requireNonNull(downstreamObserver);
}
 
源代码7 项目: resilience4j   文件: SingleRateLimiter.java
RateLimiterSingleObserver(SingleObserver<? super T> downstreamObserver) {
    super(downstreamObserver);
}
 
源代码8 项目: armeria   文件: RequestContextSingleObserver.java
RequestContextSingleObserver(SingleObserver<T> actual, RequestContext assemblyContext) {
    this.actual = actual;
    this.assemblyContext = assemblyContext;
}
 
源代码9 项目: armeria   文件: RequestContextSupplierSingle.java
@Override
protected void subscribeActual(SingleObserver<? super T> s) {
    try (SafeCloseable ignored = assemblyContext.push()) {
        source.subscribe(new RequestContextSingleObserver<>(s, assemblyContext));
    }
}
 
@Override
protected void subscribeActual(SingleObserver<? super T> s) {
    try (SafeCloseable ignored = assemblyContext.push()) {
        source.subscribe(new RequestContextSingleObserver<>(s, assemblyContext));
    }
}
 
源代码11 项目: armeria   文件: RequestContextSingle.java
@Override
protected void subscribeActual(SingleObserver<? super T> s) {
    try (SafeCloseable ignored = assemblyContext.push()) {
        source.subscribe(new RequestContextSingleObserver<>(s, assemblyContext));
    }
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法