Interface ObservableOnSubscribe<T>

  • Type Parameters:
    T - the value type pushed
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ObservableOnSubscribe<@NonNull T>
    A functional interface that has a subscribe() method that receives an ObservableEmitter instance that allows pushing events in a cancellation-safe manner.
    • Method Detail

      • subscribe

        void subscribe​(@NonNull
                       @NonNull ObservableEmitter<@NonNull T> emitter)
                throws java.lang.Throwable
        Called for each Observer that subscribes.
        Parameters:
        emitter - the safe emitter instance, never null
        Throws:
        java.lang.Throwable - on error