本文整理匯總了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();
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}