io.reactivex.rxjava3.internal.operators.observable.ObservableWindowBoundary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxjava Show documentation
Show all versions of rxjava Show documentation
Reactive Extensions for Java
/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.rxjava3.internal.operators.observable;
import java.util.concurrent.atomic.*;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.internal.disposables.DisposableHelper;
import io.reactivex.rxjava3.internal.queue.MpscLinkedQueue;
import io.reactivex.rxjava3.internal.util.AtomicThrowable;
import io.reactivex.rxjava3.observers.DisposableObserver;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.subjects.UnicastSubject;
public final class ObservableWindowBoundary extends AbstractObservableWithUpstream> {
final ObservableSource other;
final int capacityHint;
public ObservableWindowBoundary(ObservableSource source, ObservableSource other, int capacityHint) {
super(source);
this.other = other;
this.capacityHint = capacityHint;
}
@Override
public void subscribeActual(Observer super Observable> observer) {
WindowBoundaryMainObserver parent = new WindowBoundaryMainObserver<>(observer, capacityHint);
observer.onSubscribe(parent);
other.subscribe(parent.boundaryObserver);
source.subscribe(parent);
}
static final class WindowBoundaryMainObserver
extends AtomicInteger
implements Observer, Disposable, Runnable {
private static final long serialVersionUID = 2233020065421370272L;
final Observer super Observable> downstream;
final int capacityHint;
final WindowBoundaryInnerObserver boundaryObserver;
final AtomicReference upstream;
final AtomicInteger windows;
final MpscLinkedQueue
© 2015 - 2024 Weber Informatics LLC | Privacy Policy