rx.subjects.Subject.unsafeSubscribe()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中rx.subjects.Subject.unsafeSubscribe()方法的一些代码示例,展示了Subject.unsafeSubscribe()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Subject.unsafeSubscribe()方法的具体详情如下:
包路径:rx.subjects.Subject
类名称:Subject
方法名:unsafeSubscribe

Subject.unsafeSubscribe介绍

暂无

代码示例

代码示例来源:origin: akarnokd/RxJava2Interop

@Override
protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s) {
  hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriber<T> parent =
      new hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriber<T>(s);
  hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriberSubscription parentSubscription =
      new hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriberSubscription(parent);
  s.onSubscribe(parentSubscription);
  source.unsafeSubscribe(parent);
}

代码示例来源:origin: akarnokd/RxJava2Interop

@Override
protected void subscribeActual(io.reactivex.Observer<? super T> observer) {
  hu.akarnokd.rxjava.interop.ObservableV1ToObservableV2.ObservableSubscriber<T> parent =
      new hu.akarnokd.rxjava.interop.ObservableV1ToObservableV2.ObservableSubscriber<T>(observer);
  observer.onSubscribe(parent);
  source.unsafeSubscribe(parent);
}

代码示例来源:origin: com.netflix.rxjava/rxjava-core

@Override
  public void call(Subscriber<? super R> subscriber) {
    synchronized (guard) {
      if (connectedSubject.get() == null) {
        // not connected yet, so register
        waitingForConnect.add(subscriber);
      } else {
        // we are already connected so subscribe directly
        connectedSubject.get().unsafeSubscribe(subscriber);
      }
    }
  }
});

代码示例来源:origin: com.netflix.rxjava/rxjava-core

@Override
  public void call(Subscriber<? super T> s) {
    if (SRC_SUBSCRIBED_UPDATER.compareAndSet(this, 0, 1)) {
      source.unsafeSubscribe(Subscribers.from(cache));
      /*
       * Note that we will never unsubscribe from 'source' as we want to receive and cache all of its values.
       * 
       * This means this should never be used on an infinite or very large sequence, similar to toList().
       */
    }
    cache.unsafeSubscribe(s);
  }
}

代码示例来源:origin: com.github.akarnokd/rxjava2-interop

@Override
protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s) {
  hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriber<T> parent =
      new hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriber<T>(s);
  hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriberSubscription parentSubscription =
      new hu.akarnokd.rxjava.interop.ObservableV1ToFlowableV2.ObservableSubscriberSubscription(parent);
  s.onSubscribe(parentSubscription);
  source.unsafeSubscribe(parent);
}

代码示例来源:origin: com.github.akarnokd/rxjava2-interop

@Override
protected void subscribeActual(io.reactivex.Observer<? super T> observer) {
  hu.akarnokd.rxjava.interop.ObservableV1ToObservableV2.ObservableSubscriber<T> parent =
      new hu.akarnokd.rxjava.interop.ObservableV1ToObservableV2.ObservableSubscriber<T>(observer);
  observer.onSubscribe(parent);
  source.unsafeSubscribe(parent);
}

代码示例来源:origin: com.netflix.rxjava/rxjava-core

subject.unsafeSubscribe(s);

相关文章