• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SerializedSubscriber类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: call

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


示例17: call

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


示例18: call

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

    final FreezeSubscriber<T> freezeSubscriber = new FreezeSubscriber<>(
            new SerializedSubscriber<>(child),
            replaceFrozenEventPredicate);

    final Subscriber<Boolean> freezeSelectorSubscriber = new Subscriber<Boolean>() {
        @Override
        public void onCompleted() {
            freezeSubscriber.forceOnComplete();
        }

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

        @Override
        public void onNext(Boolean freeze) {
            freezeSubscriber.setFrozen(freeze);
        }
    };
    child.add(freezeSubscriber);
    child.add(freezeSelectorSubscriber);
    freezeSelector.unsafeSubscribe(freezeSelectorSubscriber);

    return freezeSubscriber;

}
 
开发者ID:MaksTuev,项目名称:ferro,代码行数:31,代码来源:OperatorFreeze.java


示例19: ExactSubscriber

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public ExactSubscriber(Subscriber<? super Observable<T>> child, Worker worker) {
    super(child);
    this.child = new SerializedSubscriber<Observable<T>>(child);
    this.worker = worker;
    this.guard = new Object();
    this.state = State.empty();
}
 
开发者ID:akarnokd,项目名称:RxJavaFlow,代码行数:8,代码来源:OperatorWindowWithTime.java


示例20: SourceSubscriber

import rx.observers.SerializedSubscriber; //导入依赖的package包/类
public SourceSubscriber(Subscriber<? super Observable<T>> child) {
    super(child);
    this.child = new SerializedSubscriber<Observable<T>>(child);
    this.guard = new Object();
    this.chunks = new LinkedList<SerializedSubject<T>>();
    this.csub = new CompositeSubscription();
    child.add(csub);
}
 
开发者ID:akarnokd,项目名称:RxJavaFlow,代码行数:9,代码来源:OperatorWindowWithStartEndObservable.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SignalServiceEnvelope类代码示例发布时间:2022-05-22
下一篇:
Java UserNotDefinedException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap