Class SyncOnSubscribe.SyncOnSubscribeImpl<S,​T>

    • Field Detail

      • generator

        private final Func0<? extends S> generator
      • next

        private final Func2<? super S,​? super Observer<? super T>,​? extends S> next
      • onUnsubscribe

        private final Action1<? super S> onUnsubscribe
    • Constructor Detail

      • SyncOnSubscribeImpl

        SyncOnSubscribeImpl​(Func0<? extends S> generator,
                            Func2<? super S,​? super Observer<? super T>,​? extends S> next,
                            Action1<? super S> onUnsubscribe)
      • SyncOnSubscribeImpl

        public SyncOnSubscribeImpl​(Func0<? extends S> generator,
                                   Func2<? super S,​? super Observer<? super T>,​? extends S> next)
      • SyncOnSubscribeImpl

        public SyncOnSubscribeImpl​(Func2<S,​Observer<? super T>,​S> next,
                                   Action1<? super S> onUnsubscribe)
      • SyncOnSubscribeImpl

        public SyncOnSubscribeImpl​(Func2<S,​Observer<? super T>,​S> nextFunc)
    • Method Detail

      • next

        protected S next​(S state,
                         Observer<? super T> observer)
        Description copied from class: SyncOnSubscribe
        Called to produce data to the downstream subscribers. To emit data to a downstream subscriber call observer.onNext(t). To signal an error condition call observer.onError(throwable) or throw an Exception. To signal the end of a data stream call observer.onCompleted(). Implementations of this method must follow the following rules.
        • Must not call observer.onNext(t) more than 1 time per invocation.
        • Must not call observer.onNext(t) concurrently.
        The value returned from an invocation of this method will be passed in as the state argument of the next invocation of this method.
        Specified by:
        next in class SyncOnSubscribe<S,​T>
        Parameters:
        state - the state value (from SyncOnSubscribe.generateState() on the first invocation or the previous invocation of this method.
        observer - the observer of data emitted by
        Returns:
        the next iteration's state value