本文整理了Java中rx.subjects.Subject.onCompleted()
方法的一些代码示例,展示了Subject.onCompleted()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Subject.onCompleted()
方法的具体详情如下:
包路径:rx.subjects.Subject
类名称:Subject
方法名:onCompleted
暂无
代码示例来源:origin: PipelineAI/pipeline
public void shutdown() {
writeOnlyCommandStartSubject.onCompleted();
writeOnlyCommandCompletionSubject.onCompleted();
writeOnlyCollapserSubject.onCompleted();
}
代码示例来源:origin: PipelineAI/pipeline
public void shutdown() {
writeOnlyRequestEventsSubject.onCompleted();
}
代码示例来源:origin: akarnokd/RxJava2Interop
@Override
public void onComplete() {
if (!terminated) {
terminated = true;
source.onCompleted();
}
}
代码示例来源:origin: akarnokd/RxJava2Interop
@Override
public void onComplete() {
if (!terminated) {
terminated = true;
source.onCompleted();
}
}
代码示例来源:origin: com.netflix.hystrix/hystrix-core
public void shutdown() {
writeOnlyCommandStartSubject.onCompleted();
writeOnlyCommandCompletionSubject.onCompleted();
writeOnlyCollapserSubject.onCompleted();
}
代码示例来源:origin: com.netflix.eureka/eureka2-core
@Override
public void onCompleted() {
if (isCompleted.compareAndSet(false, true)) {
ackSubject.onCompleted();
}
}
代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-rxjava
@Override
public synchronized void stop() {
if (this.running) {
this.subject.onCompleted();
this.subscription.unsubscribe();
this.subscription = null;
this.subject = null;
this.running = false;
}
}
}
代码示例来源:origin: com.netflix.eureka/eureka2-client
public void close() {
interests.clear();
interestSubject.onCompleted();
}
}
代码示例来源:origin: ru.yandex.cocaine/cocaine-client
public void onCompleted(long id) {
Session session = sessions.remove(id);
if (session != null) {
logger.debug("Closing session " + id);
session.input.onCompleted();
} else {
logger.warn("Session " + id + " does not exist");
}
}
代码示例来源:origin: com.netflix.eureka/eureka2-core
private void terminateLifecycle(Throwable e) {
if (e == null) {
lifecycleSubject.onCompleted();
} else {
lifecycleSubject.onError(e);
}
}
代码示例来源:origin: com.netflix.eureka/eureka2-core
@Override
public final void close() {
_close();
lifecycle.onCompleted();
}
代码示例来源:origin: com.netflix.eureka/eureka2-core
@Override
public void call(Acknowledgement acknowledgement) {
PendingAck pending = pendingAckQueue.poll();
metrics.decrementPendingAckCounter();
if (pending == null) {
shutdown(new IllegalStateException("{connection=" + name + "}: unexpected acknowledgment"));
} else {
pending.ackSubject.onCompleted();
}
}
});
代码示例来源:origin: com.netflix.eureka/eureka2-client
@Override
public Observable<Void> shutdown() {
remoteBatchingRegistry.shutdown();
relay.onCompleted();
return Observable.empty();
}
代码示例来源:origin: com.netflix.eureka2/eureka-bridge
@Override
protected void _close() {
discoveryClient.shutdown();
registry.shutdown();
lifecycle.onCompleted();
}
}
代码示例来源:origin: akarnokd/RxJava2Interop
@Test
public void sj2ToSj1Normal() {
io.reactivex.subjects.PublishSubject<Integer> ps2 = io.reactivex.subjects.PublishSubject.create();
rx.subjects.Subject<Integer, Integer> sj1 = toV1Subject(ps2);
rx.observers.AssertableSubscriber<Integer> to = sj1.test();
assertTrue(sj1.hasObservers());
assertTrue(ps2.hasObservers());
sj1.onNext(1);
sj1.onNext(2);
sj1.onCompleted();
assertFalse(sj1.hasObservers());
assertFalse(ps2.hasObservers());
to.assertResult(1, 2);
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public void call() {
try {
obs.onNext(response);
obs.onCompleted();
} catch(Exception ex) {
obs.onError(ex);
} finally {
worker.unsubscribe();
}
}
});
代码示例来源:origin: akarnokd/RxJava2Interop
@Test
public void fp2ToSj1Normal() {
io.reactivex.processors.FlowableProcessor<Integer> pp2 = io.reactivex.processors.PublishProcessor.create();
rx.subjects.Subject<Integer, Integer> sj1 = toV1Subject(pp2);
rx.observers.AssertableSubscriber<Integer> to = sj1.test();
assertTrue(sj1.hasObservers());
assertTrue(pp2.hasSubscribers());
sj1.onNext(1);
sj1.onNext(2);
sj1.onCompleted();
assertFalse(sj1.hasObservers());
assertFalse(pp2.hasSubscribers());
assertTrue(pp2.hasComplete());
assertFalse(pp2.hasThrowable());
assertNull(pp2.getThrowable());
to.assertResult(1, 2);
}
代码示例来源:origin: com.couchbase.client/core-io
public void add(final StatResponse response) {
if (response.key() == null) {
// Skip NULL-terminator for successful response
if (!response.status().isSuccess()) {
observable().onNext(response);
}
observable().onCompleted();
} else {
observable().onNext(response);
}
}
代码示例来源:origin: couchbase/couchbase-jvm-core
public void add(final StatResponse response) {
if (response.key() == null) {
// Skip NULL-terminator for successful response
if (!response.status().isSuccess()) {
observable().onNext(response);
}
observable().onCompleted();
} else {
observable().onNext(response);
}
}
代码示例来源:origin: akarnokd/RxJava2Interop
@Test
public void fp2ToSj1Backpressured() {
io.reactivex.processors.FlowableProcessor<Integer> pp2 = io.reactivex.processors.ReplayProcessor.create();
rx.subjects.Subject<Integer, Integer> sj1 = toV1Subject(pp2);
rx.observers.AssertableSubscriber<Integer> to = sj1.test(0L);
assertTrue(sj1.hasObservers());
assertTrue(pp2.hasSubscribers());
sj1.onNext(1);
sj1.onNext(2);
sj1.onNext(3);
sj1.onNext(4);
to.assertNoValues().assertNoErrors().assertNotCompleted();
to.requestMore(1).assertValue(1).assertNoErrors().assertNotCompleted();
to.requestMore(2).assertValues(1, 2, 3).assertNoErrors().assertNotCompleted();
sj1.onCompleted();
to.assertValues(1, 2, 3).assertNoErrors().assertNotCompleted();
assertFalse(sj1.hasObservers());
assertFalse(pp2.hasSubscribers());
assertTrue(pp2.hasComplete());
assertFalse(pp2.hasThrowable());
assertNull(pp2.getThrowable());
to
.requestMore(1)
.assertResult(1, 2, 3, 4);
}
内容来源于网络,如有侵权,请联系作者删除!