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


Java Exceptions.throwOrReport方法代码示例

本文整理汇总了Java中rx.exceptions.Exceptions.throwOrReport方法的典型用法代码示例。如果您正苦于以下问题:Java Exceptions.throwOrReport方法的具体用法?Java Exceptions.throwOrReport怎么用?Java Exceptions.throwOrReport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rx.exceptions.Exceptions的用法示例。


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

示例1: call

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public Subscription call(final TimeoutSubscriber<T> timeoutSubscriber, final Long seqId, Worker inner) {
    if (this.val$firstTimeoutSelector == null) {
        return Subscriptions.unsubscribed();
    }
    try {
        return ((Observable) this.val$firstTimeoutSelector.call()).unsafeSubscribe(new Subscriber<U>() {
            public void onCompleted() {
                timeoutSubscriber.onTimeout(seqId.longValue());
            }

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

            public void onNext(U u) {
                timeoutSubscriber.onTimeout(seqId.longValue());
            }
        });
    } catch (Throwable t) {
        Exceptions.throwOrReport(t, timeoutSubscriber);
        return Subscriptions.unsubscribed();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:OperatorTimeoutWithSelector.java

示例2: request

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void request(long n) {
    if (n < 0) {
        throw new IllegalArgumentException("n >= 0 required");
    } else if (n != 0 && compareAndSet(false, true)) {
        Subscriber<? super T> c = this.child;
        T v = this.value;
        if (!c.isUnsubscribed()) {
            try {
                c.onNext(v);
                if (!c.isUnsubscribed()) {
                    c.onCompleted();
                }
            } catch (Throwable e) {
                Exceptions.throwOrReport(e, c, v);
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:SingleProducer.java

示例3: call

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void call(Subscriber<? super T> subscriber) {
    subscriber.add(Subscriptions.create(new Action0() {
        public void call() {
            ToObservableFuture.this.that.cancel(true);
        }
    }));
    try {
        if (!subscriber.isUnsubscribed()) {
            subscriber.onNext(this.unit == null ? this.that.get() : this.that.get(this.time, this.unit));
            subscriber.onCompleted();
        }
    } catch (Throwable e) {
        if (!subscriber.isUnsubscribed()) {
            Exceptions.throwOrReport(e, subscriber);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:OnSubscribeToObservableFuture.java

示例4: onNext

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public boolean onNext(int index, T t) {
    synchronized (this) {
        if (!this.haveValues.get(index)) {
            this.haveValues.set(index);
            this.haveValuesCount++;
        }
        this.collectedValues[index] = t;
        if (this.haveValuesCount != this.collectedValues.length) {
            return false;
        }
        try {
            this.buffer.onNext(this.combinator.call(this.collectedValues));
        } catch (MissingBackpressureException e) {
            onError(e);
        } catch (Throwable e2) {
            Exceptions.throwOrReport(e2, this.child);
        }
        tick();
        return true;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:OnSubscribeCombineLatest.java

示例5: onCompleted

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void onCompleted() {
    try {
        this.inner.unsubscribe();
        synchronized (this) {
            if (this.done) {
                return;
            }
            this.done = true;
            List<T> toEmit = this.chunk;
            this.chunk = null;
            this.child.onNext(toEmit);
            this.child.onCompleted();
            unsubscribe();
        }
    } catch (Throwable t) {
        Exceptions.throwOrReport(t, this.child);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:OperatorBufferWithTime.java

示例6: onNext

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void onNext(T t) {
    try {
        Object key = groupedKey(this.keySelector.call(t));
        GroupState<K, T> group = (GroupState) this.groups.get(key);
        if (group == null) {
            if (!this.child.isUnsubscribed()) {
                group = createNewGroup(key);
            } else {
                return;
            }
        }
        if (group != null) {
            emitItem(group, nl.next(t));
        }
    } catch (Throwable e) {
        Exceptions.throwOrReport(e, this, t);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:OperatorGroupBy.java

示例7: onNext

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void onNext(T1 args) {
    try {
        int id;
        Subject<T2, T2> subj = PublishSubject.create();
        Observer<T2> subjSerial = new SerializedObserver(subj);
        synchronized (ResultManager.this.guard) {
            ResultManager resultManager = ResultManager.this;
            id = resultManager.leftIds;
            resultManager.leftIds = id + 1;
            ResultManager.this.leftMap.put(Integer.valueOf(id), subjSerial);
        }
        Observable<T2> window = Observable.create(new WindowObservableFunc(subj, ResultManager.this.cancel));
        Observable<D1> duration = (Observable) OnSubscribeGroupJoin.this.leftDuration.call(args);
        Subscriber<D1> d1 = new LeftDurationObserver(id);
        ResultManager.this.group.add(d1);
        duration.unsafeSubscribe(d1);
        R result = OnSubscribeGroupJoin.this.resultSelector.call(args, window);
        synchronized (ResultManager.this.guard) {
            List<T2> rightMapValues = new ArrayList(ResultManager.this.rightMap.values());
        }
        ResultManager.this.subscriber.onNext(result);
        for (T2 t2 : rightMapValues) {
            subjSerial.onNext(t2);
        }
    } catch (Throwable t) {
        Exceptions.throwOrReport(t, this);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:29,代码来源:OnSubscribeGroupJoin.java

示例8: emit

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
void emit() {
    synchronized (this) {
        if (this.done) {
            return;
        }
        List<T> toEmit = this.chunk;
        this.chunk = new ArrayList(OperatorBufferWithSingleObservable.this.initialCapacity);
        try {
            this.child.onNext(toEmit);
        } catch (Throwable t) {
            unsubscribe();
            synchronized (this) {
                if (!this.done) {
                    this.done = true;
                    Exceptions.throwOrReport(t, this.child);
                }
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:OperatorBufferWithSingleObservable.java

示例9: onCompleted

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void onCompleted() {
    try {
        this.emitter.offerAndComplete(OperatorMapNotification.this.onCompleted.call());
    } catch (Throwable e) {
        Exceptions.throwOrReport(e, this.o);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:OperatorMapNotification.java

示例10: emit

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
private static <T> void emit(Subscriber<? super T> c, T v) {
    if (!c.isUnsubscribed()) {
        try {
            c.onNext(v);
            if (!c.isUnsubscribed()) {
                c.onCompleted();
            }
        } catch (Throwable e) {
            Exceptions.throwOrReport(e, c, v);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:SingleDelayedProducer.java

示例11: onNext

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void onNext(T t) {
    try {
        this.emitter.offer(OperatorMapNotification.this.onNext.call(t));
    } catch (Throwable e) {
        Exceptions.throwOrReport(e, this.o, t);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:OperatorMapNotification.java

示例12: onNext

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void onNext(TRight args) {
    synchronized (ResultSink.this.guard) {
        ResultSink resultSink = ResultSink.this;
        int id = resultSink.rightId;
        resultSink.rightId = id + 1;
        ResultSink.this.rightMap.put(Integer.valueOf(id), args);
        int highLeftId = ResultSink.this.leftId;
    }
    ResultSink.this.group.add(new SerialSubscription());
    try {
        Observable<TRightDuration> duration = (Observable) OnSubscribeJoin.this.rightDurationSelector.call(args);
        Subscriber<TRightDuration> d2 = new RightDurationSubscriber(id);
        ResultSink.this.group.add(d2);
        duration.unsafeSubscribe(d2);
        List<TLeft> leftValues = new ArrayList();
        synchronized (ResultSink.this.guard) {
            for (Entry<Integer, TLeft> entry : ResultSink.this.leftMap.entrySet()) {
                if (((Integer) entry.getKey()).intValue() < highLeftId) {
                    leftValues.add(entry.getValue());
                }
            }
        }
        for (TLeft lv : leftValues) {
            ResultSink.this.subscriber.onNext(OnSubscribeJoin.this.resultSelector.call(lv, args));
        }
    } catch (Throwable t) {
        Exceptions.throwOrReport(t, this);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:30,代码来源:OnSubscribeJoin.java

示例13: startBuffer

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
void startBuffer(TOpening v) {
    final List<T> chunk = new ArrayList();
    synchronized (this) {
        if (this.done) {
            return;
        }
        this.chunks.add(chunk);
        try {
            Observable<? extends TClosing> cobs = (Observable) OperatorBufferWithStartEndObservable.this.bufferClosing.call(v);
            Subscriber<TClosing> closeSubscriber = new Subscriber<TClosing>() {
                public void onNext(TClosing tClosing) {
                    BufferingSubscriber.this.closingSubscriptions.remove(this);
                    BufferingSubscriber.this.endBuffer(chunk);
                }

                public void onError(Throwable e) {
                    BufferingSubscriber.this.onError(e);
                }

                public void onCompleted() {
                    BufferingSubscriber.this.closingSubscriptions.remove(this);
                    BufferingSubscriber.this.endBuffer(chunk);
                }
            };
            this.closingSubscriptions.add(closeSubscriber);
            cobs.unsafeSubscribe(closeSubscriber);
        } catch (Throwable t) {
            Exceptions.throwOrReport(t, this);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:32,代码来源:OperatorBufferWithStartEndObservable.java

示例14: emit

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
void emit() {
    synchronized (this) {
        if (this.done) {
            return;
        }
        List<T> toEmit = this.chunk;
        this.chunk = new ArrayList();
        try {
            this.child.onNext(toEmit);
        } catch (Throwable t) {
            Exceptions.throwOrReport(t, this);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:15,代码来源:OperatorBufferWithTime.java

示例15: call

import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public void call() {
    T localValue = this.value.getAndSet(EMPTY_TOKEN);
    if (localValue != EMPTY_TOKEN) {
        try {
            this.subscriber.onNext(localValue);
        } catch (Throwable e) {
            Exceptions.throwOrReport(e, this);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:OperatorSampleWithTime.java


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