当前位置: 首页>>代码示例>>Java>>正文


Java SerializedSubscriber类代码示例

本文整理汇总了Java中rx.observers.SerializedSubscriber的典型用法代码示例。如果您正苦于以下问题:Java SerializedSubscriber类的具体用法?Java SerializedSubscriber怎么用?Java SerializedSubscriber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SerializedSubscriber类属于rx.observers包,在下文中一共展示了SerializedSubscriber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super List<T>> child) {
    final BufferingSubscriber bsub = new BufferingSubscriber(new SerializedSubscriber(child));
    Subscriber<TOpening> openSubscriber = new Subscriber<TOpening>() {
        public void onNext(TOpening t) {
            bsub.startBuffer(t);
        }

        public void onError(Throwable e) {
            bsub.onError(e);
        }

        public void onCompleted() {
            bsub.onCompleted();
        }
    };
    child.add(openSubscriber);
    child.add(bsub);
    this.bufferOpening.unsafeSubscribe(openSubscriber);
    return bsub;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:OperatorBufferWithStartEndObservable.java

示例2: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super List<T>> child) {
    Worker inner = this.scheduler.createWorker();
    SerializedSubscriber<List<T>> serialized = new SerializedSubscriber(child);
    if (this.timespan == this.timeshift) {
        ExactSubscriber bsub = new ExactSubscriber(serialized, inner);
        bsub.add(inner);
        child.add(bsub);
        bsub.scheduleExact();
        return bsub;
    }
    Subscriber bsub2 = new InexactSubscriber(serialized, inner);
    bsub2.add(inner);
    child.add(bsub2);
    bsub2.startNewChunk();
    bsub2.scheduleChunk();
    return bsub2;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:OperatorBufferWithTime.java

示例3: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super List<T>> child) {
    try {
        Observable<? extends TClosing> closing = (Observable) this.bufferClosingSelector.call();
        final BufferingSubscriber bsub = new BufferingSubscriber(new SerializedSubscriber(child));
        Subscriber<TClosing> closingSubscriber = new Subscriber<TClosing>() {
            public void onNext(TClosing tClosing) {
                bsub.emit();
            }

            public void onError(Throwable e) {
                bsub.onError(e);
            }

            public void onCompleted() {
                bsub.onCompleted();
            }
        };
        child.add(closingSubscriber);
        child.add(bsub);
        closing.unsafeSubscribe(closingSubscriber);
        return bsub;
    } catch (Throwable t) {
        Exceptions.throwOrReport(t, child);
        return Subscribers.empty();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:OperatorBufferWithSingleObservable.java

示例4: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
@Override
public Subscriber<? super T> call(final Subscriber<? super T> s) {
    return new SerializedSubscriber<T>(new Subscriber<T>(s) {

        @Override
        public void onCompleted() {
            s.onCompleted();
        }

        @Override
        public void onError(Throwable e) {
            s.onError(e);
        }

        @Override
        public void onNext(T t) {
            s.onNext(t);
        }

    });
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:22,代码来源:OperatorSerialize.java

示例5: ExactSubscriber

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public ExactSubscriber(Subscriber<? super Observable<T>> child, Worker worker) {
    this.child = new SerializedSubscriber(child);
    this.worker = worker;
    child.add(Subscriptions.create(new Action0(OperatorWindowWithTime.this) {
        public void call() {
            if (ExactSubscriber.this.state.consumer == null) {
                ExactSubscriber.this.unsubscribe();
            }
        }
    }));
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:OperatorWindowWithTime.java

示例6: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(final Subscriber<? super T> s) {
    return new SerializedSubscriber(new Subscriber<T>(s) {
        public void onCompleted() {
            s.onCompleted();
        }

        public void onError(Throwable e) {
            s.onError(e);
        }

        public void onNext(T t) {
            s.onNext(t);
        }
    });
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:16,代码来源:OperatorSerialize.java

示例7: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super T> child) {
    SerializedSubscriber<T> s = new SerializedSubscriber(child);
    Worker worker = this.scheduler.createWorker();
    child.add(worker);
    SamplerSubscriber<T> sampler = new SamplerSubscriber(s);
    child.add(sampler);
    worker.schedulePeriodically(sampler, this.time, this.time, this.unit);
    return sampler;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:OperatorSampleWithTime.java

示例8: TimeoutSubscriber

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
private TimeoutSubscriber(SerializedSubscriber<T> serializedSubscriber, TimeoutStub<T> timeoutStub, SerialSubscription serial, Observable<? extends T> other, Worker inner) {
    super(serializedSubscriber);
    this.gate = new Object();
    this.terminated = new AtomicInteger();
    this.actual = new AtomicLong();
    this.serializedSubscriber = serializedSubscriber;
    this.timeoutStub = timeoutStub;
    this.serial = serial;
    this.other = other;
    this.inner = inner;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:OperatorTimeoutBase.java

示例9: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super T> subscriber) {
    Worker inner = this.scheduler.createWorker();
    subscriber.add(inner);
    SerialSubscription serial = new SerialSubscription();
    subscriber.add(serial);
    TimeoutSubscriber<T> timeoutSubscriber = new TimeoutSubscriber(new SerializedSubscriber(subscriber), this.timeoutStub, serial, this.other, inner);
    serial.set((Subscription) this.firstTimeoutStub.call(timeoutSubscriber, Long.valueOf(0), inner));
    return timeoutSubscriber;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:OperatorTimeoutBase.java

示例10: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super T> child) {
    Worker worker = this.scheduler.createWorker();
    child.add(worker);
    TakeSubscriber<T> ts = new TakeSubscriber(new SerializedSubscriber(child));
    worker.schedule(ts, this.time, this.unit);
    return ts;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:OperatorTakeTimed.java

示例11: SwitchSubscriber

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
SwitchSubscriber(Subscriber<? super T> child) {
    this.serializedChild = new SerializedSubscriber(child);
    this.arbiter = new ProducerArbiter();
    this.ssub = new SerialSubscription();
    child.add(this.ssub);
    child.setProducer(new Producer() {
        public void request(long n) {
            if (n > 0) {
                SwitchSubscriber.this.arbiter.request(n);
            }
        }
    });
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:OperatorSwitch.java

示例12: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super Observable<? extends T>> call(Subscriber<? super T> child) {
    SerializedSubscriber<T> s = new SerializedSubscriber(child);
    SerialSubscription current = new SerialSubscription();
    child.add(current);
    ConcatSubscriber<T> cs = new ConcatSubscriber(s, current);
    child.setProducer(new ConcatProducer(cs));
    return cs;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:OperatorConcat.java

示例13: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public Subscriber<? super T> call(Subscriber<? super T> child) {
    final Worker worker = this.scheduler.createWorker();
    final SerializedSubscriber<T> s = new SerializedSubscriber(child);
    final SerialSubscription ssub = new SerialSubscription();
    s.add(worker);
    s.add(ssub);
    return new Subscriber<T>(child) {
        final Subscriber<?> self = this;
        final DebounceState<T> state = new DebounceState();

        public void onStart() {
            request(Long.MAX_VALUE);
        }

        public void onNext(T t) {
            final int index = this.state.next(t);
            ssub.set(worker.schedule(new Action0() {
                public void call() {
                    AnonymousClass1.this.state.emit(index, s, AnonymousClass1.this.self);
                }
            }, OperatorDebounceWithTime.this.timeout, OperatorDebounceWithTime.this.unit));
        }

        public void onError(Throwable e) {
            s.onError(e);
            unsubscribe();
            this.state.clear();
        }

        public void onCompleted() {
            this.state.emitAndComplete(s, this);
        }
    };
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:35,代码来源:OperatorDebounceWithTime.java

示例14: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
@Override
public Subscriber<? super JsonPathEvent> call(Subscriber<? super JsonObjectEvent> s) {
  Subscriber<? super JsonObjectEvent> downstream = new SerializedSubscriber<>(s);
  PathEventSubscriber upstream = new PathEventSubscriber();
  downstream.add(upstream);
  downstream.setProducer(new JsonObjectProducer(upstream, downstream));
  return upstream;
}
 
开发者ID:Trunkplatform,项目名称:rxjava-json,代码行数:9,代码来源:OperatorCollectObjects.java

示例15: call

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
@Override
public Subscriber<? super Character> call(Subscriber<? super JsonTokenEvent> s) {
  Subscriber<? super JsonTokenEvent> downstream = new SerializedSubscriber<>(s);
  JsonParser upstream = new JsonParser(lenient);
  downstream.add(upstream);
  downstream.setProducer(new ParserProducer(upstream, downstream));
  return upstream;
}
 
开发者ID:Trunkplatform,项目名称:rxjava-json,代码行数:9,代码来源:OperatorJsonToken.java


注:本文中的rx.observers.SerializedSubscriber类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。