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

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

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

Subject.onNext介绍

暂无

代码示例

代码示例来源:origin: PipelineAI/pipeline

public void write(HystrixCommandExecutionStarted event) {
  writeOnlySubject.onNext(event);
}

代码示例来源:origin: PipelineAI/pipeline

public void write(HystrixCommandCompletion event) {
  writeOnlySubject.onNext(event);
}

代码示例来源:origin: PipelineAI/pipeline

public void write(HystrixCommandCompletion event) {
  writeOnlySubject.onNext(event);
}

代码示例来源:origin: PipelineAI/pipeline

public void write(HystrixCommandExecutionStarted event) {
  writeOnlySubject.onNext(event);
}

代码示例来源:origin: PipelineAI/pipeline

public void write(HystrixCollapserEvent event) {
  writeOnlyStream.onNext(event);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

/**
 * 发送消息
 */
public void post(Object object) {
  bus.onNext(object);
}

代码示例来源:origin: PipelineAI/pipeline

public void collapserBatchExecuted(HystrixCollapserKey collapserKey, int batchSize) {
  HystrixCollapserEvent batchExecution = HystrixCollapserEvent.from(collapserKey, HystrixEventType.Collapser.BATCH_EXECUTED, 1);
  HystrixCollapserEvent batchAdditions = HystrixCollapserEvent.from(collapserKey, HystrixEventType.Collapser.ADDED_TO_BATCH, batchSize);
  writeOnlyCollapserSubject.onNext(batchExecution);
  writeOnlyCollapserSubject.onNext(batchAdditions);
}

代码示例来源:origin: PipelineAI/pipeline

public void commandExecutionStarted(HystrixCommandKey commandKey, HystrixThreadPoolKey threadPoolKey,
                  HystrixCommandProperties.ExecutionIsolationStrategy isolationStrategy, int currentConcurrency) {
  HystrixCommandExecutionStarted event = new HystrixCommandExecutionStarted(commandKey, threadPoolKey, isolationStrategy, currentConcurrency);
  writeOnlyCommandStartSubject.onNext(event);
}

代码示例来源:origin: PipelineAI/pipeline

public void collapserResponseFromCache(HystrixCollapserKey collapserKey) {
  HystrixCollapserEvent collapserEvent = HystrixCollapserEvent.from(collapserKey, HystrixEventType.Collapser.RESPONSE_FROM_CACHE, 1);
  writeOnlyCollapserSubject.onNext(collapserEvent);
}

代码示例来源:origin: PipelineAI/pipeline

public void write(Collection<HystrixInvokableInfo<?>> executions) {
  HystrixRequestEvents requestEvents = new HystrixRequestEvents(executions);
  writeOnlyRequestEventsSubject.onNext(requestEvents);
}

代码示例来源:origin: PipelineAI/pipeline

public void executionDone(ExecutionResult executionResult, HystrixCommandKey commandKey, HystrixThreadPoolKey threadPoolKey) {
  HystrixCommandCompletion event = HystrixCommandCompletion.from(executionResult, commandKey, threadPoolKey);
  writeOnlyCommandCompletionSubject.onNext(event);
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

/**
 * 触发事件
 *
 * @param content
 */
@SuppressWarnings({"unchecked", "rawtypes"})
public void post(@NonNull Object tag, @NonNull Object content) {
  LogUtils.logd("post"+ "eventName: " + tag);
  List<Subject> subjectList = subjectMapper.get(tag);
  if (!isEmpty(subjectList)) {
    for (Subject subject : subjectList) {
      subject.onNext(content);
      LogUtils.logd("onEvent"+ "eventName: " + tag);
    }
  }
}

代码示例来源:origin: THEONE10211024/RxJavaSamples

public void send(Object o) {
  _bus.onNext(o);
}

代码示例来源:origin: kaku2015/ColorfulNews

public void post(Object o) {
  mBus.onNext(o);
}

代码示例来源:origin: cn-ljb/rxjava_for_android

public void send(Object o) {
  _bus.onNext(o);
}

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

@Override
public void onNext(T t) {
  if (!terminated) {
    if (t == null) {
      onError(new NullPointerException());
    } else {
      source.onNext(t);
    }
  }
}

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

@Override
public void onNext(T t) {
  if (!terminated) {
    if (t == null) {
      onError(new NullPointerException());
    } else {
      source.onNext(t);
    }
  }
}

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

@Test
public void sj2ToSj1Normal() {
  io.reactivex.subjects.PublishSubject<Integer> ps2 = io.reactivex.subjects.PublishSubject.create();
  rx.subjects.Subject<Integer, Integer> sj1 = toV1Subject(ps2);
  rx.observers.AssertableSubscriber<Integer> to = sj1.test();
  assertTrue(sj1.hasObservers());
  assertTrue(ps2.hasObservers());
  sj1.onNext(1);
  sj1.onNext(2);
  sj1.onCompleted();
  assertFalse(sj1.hasObservers());
  assertFalse(ps2.hasObservers());
  to.assertResult(1, 2);
}

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

@Test
public void sj2ToSj1Lifecycle() {
  io.reactivex.subjects.PublishSubject<Integer> pp2 = io.reactivex.subjects.PublishSubject.create();
  rx.subjects.Subject<Integer, Integer> sj1 = toV1Subject(pp2);
  rx.observers.AssertableSubscriber<Integer> to = sj1.test(0L);
  assertTrue(sj1.hasObservers());
  assertTrue(pp2.hasObservers());
  sj1.onNext(1);
  sj1.onError(new IOException());
  assertFalse(sj1.hasObservers());
  assertFalse(pp2.hasObservers());
  assertFalse(pp2.hasComplete());
  assertTrue(pp2.hasThrowable());
  assertNotNull(pp2.getThrowable());
  to.assertFailure(rx.exceptions.MissingBackpressureException.class);
}

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

@Test
public void sj2ToSj1Backpressured() {
  io.reactivex.subjects.PublishSubject<Integer> pp2 = io.reactivex.subjects.PublishSubject.create();
  rx.subjects.Subject<Integer, Integer> sj1 = toV1Subject(pp2);
  rx.observers.AssertableSubscriber<Integer> to = sj1.test(0L);
  assertTrue(sj1.hasObservers());
  assertTrue(pp2.hasObservers());
  sj1.onNext(1);
  assertFalse(sj1.hasObservers());
  assertFalse(pp2.hasObservers());
  assertFalse(pp2.hasComplete());
  assertFalse(pp2.hasThrowable());
  assertNull(pp2.getThrowable());
  to.assertFailure(rx.exceptions.MissingBackpressureException.class);
}

相关文章