1
저는 SkipUntil 연산자를 찾고 있지만 예상대로 작동하지 않는 것 같습니다. 여기 그래서 모든 항목을 건너 뛰어야 운영자 skipUntil를 사용하여 첫 번째 관찰 항목을 방출하지 않는, 내 코드SkipUntil이 예상대로 작동하지 않습니다.
@Test
public void testSkiUitil() throws InterruptedException {
List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
Observable observable2 = Observable.just(1);
Subscription subscription = Observable.from(numbers)
.skipUntil(observable2)
.subscribe(System.out::println);
Thread.sleep(3000);
observable2.subscribe();
new TestSubscriber((Observer) subscription).awaitTerminalEvent(5, TimeUnit.SECONDS);
}
내가 observable2 어떤 구독을 가지고 있지 않기 때문에 그 증명하려고했던 것입니다. 그러나 여전히 5 가지 항목 모두를 방출하고 있습니다.
왜 그런가요?
의사가 말합니다.
Returns an Observable that skips items emitted by the source Observable until a second Observable emits