类 ChannelSendOperator.WriteBarrier

java.lang.Object
cn.taketoday.http.server.reactive.ChannelSendOperator.WriteBarrier
所有已实现的接口:
org.reactivestreams.Publisher<T>, org.reactivestreams.Subscriber<T>, org.reactivestreams.Subscription, reactor.core.CoreSubscriber<T>
封闭类:
ChannelSendOperator<T>

private class ChannelSendOperator.WriteBarrier extends Object implements reactor.core.CoreSubscriber<T>, org.reactivestreams.Subscription, org.reactivestreams.Publisher<T>
A barrier inserted between the write source and the write subscriber (i.e. the HTTP server adapter) that pre-fetches and waits for the first signal before deciding whether to hook in to the write subscriber.

Acts as:

  • Subscriber to the write source.
  • Subscription to the write subscriber.
  • Publisher to the write subscriber.

Also uses ChannelSendOperator<T>.WriteCompletionBarrier to communicate completion and detect cancel signals from the completion subscriber.

  • 字段详细资料

    • writeCompletionBarrier

      private final ChannelSendOperator<T>.WriteCompletionBarrier writeCompletionBarrier
    • subscription

      @Nullable private org.reactivestreams.Subscription subscription
    • item

      @Nullable private T item
      Cached data item before readyToWrite.
    • error

      @Nullable private Throwable error
      Cached error signal before readyToWrite.
    • completed

      private boolean completed
      Cached onComplete signal before readyToWrite.
    • demandBeforeReadyToWrite

      private long demandBeforeReadyToWrite
      Recursive demand while emitting cached signals.
    • state

      Current state.
    • writeSubscriber

      @Nullable private org.reactivestreams.Subscriber<? super T> writeSubscriber
      The actual writeSubscriber from the HTTP server adapter.
  • 构造器详细资料

    • WriteBarrier

      WriteBarrier(reactor.core.CoreSubscriber<? super Void> completionSubscriber)
  • 方法详细资料

    • onSubscribe

      public final void onSubscribe(org.reactivestreams.Subscription s)
      指定者:
      onSubscribe 在接口中 reactor.core.CoreSubscriber<T>
      指定者:
      onSubscribe 在接口中 org.reactivestreams.Subscriber<T>
    • onNext

      public final void onNext(T item)
      指定者:
      onNext 在接口中 org.reactivestreams.Subscriber<T>
    • requiredWriteSubscriber

      private org.reactivestreams.Subscriber<? super T> requiredWriteSubscriber()
    • onError

      public final void onError(Throwable ex)
      指定者:
      onError 在接口中 org.reactivestreams.Subscriber<T>
    • onComplete

      public final void onComplete()
      指定者:
      onComplete 在接口中 org.reactivestreams.Subscriber<T>
    • currentContext

      public reactor.util.context.Context currentContext()
      指定者:
      currentContext 在接口中 reactor.core.CoreSubscriber<T>
    • request

      public void request(long n)
      指定者:
      request 在接口中 org.reactivestreams.Subscription
    • emitCachedSignals

      private boolean emitCachedSignals()
    • cancel

      public void cancel()
      指定者:
      cancel 在接口中 org.reactivestreams.Subscription
    • releaseCachedItem

      private void releaseCachedItem()
    • subscribe

      public void subscribe(org.reactivestreams.Subscriber<? super T> writeSubscriber)
      指定者:
      subscribe 在接口中 org.reactivestreams.Publisher<T>