// Path: src/main/java/com/github/davidmoten/rx2/StateMachine.java
// public static interface Emitter<T> {
//     void onNext_(T t);
// 
//     void onError_(Throwable e);
// 
//     void onComplete_();
// 
//     void cancel_();
// }
// 
// Path: src/main/java/com/github/davidmoten/rx2/functions/Consumer3.java
// public interface Consumer3<A, B, C> {
// 
//     void accept(A a, B b, C c);
// 
// }


import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.rx2.StateMachine.Emitter;
import com.github.davidmoten.rx2.functions.Consumer3;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Flowable;
import io.reactivex.FlowableSubscriber;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.BiConsumer;
import io.reactivex.functions.Function3;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.fuseable.SimplePlainQueue;
import io.reactivex.internal.queue.SpscLinkedArrayQueue;
import io.reactivex.internal.subscriptions.SubscriptionHelper;
import io.reactivex.internal.util.BackpressureHelper;
import io.reactivex.plugins.RxJavaPlugins;
package com.github.davidmoten.rx2.internal.flowable;





public final class FlowableStateMachine<State, In, Out> extends Flowable<Out> {

    private final Flowable<In> source;
    private final Callable<? extends State> initialState;
// Path: src/main/java/com/github/davidmoten/rx2/StateMachine.java
// public static interface Emitter<T> {
//     void onNext_(T t);
// 
//     void onError_(Throwable e);
// 
//     void onComplete_();
// 
//     void cancel_();
// }
// 
// Path: src/main/java/com/github/davidmoten/rx2/functions/Consumer3.java
// public interface Consumer3<A, B, C> {
// 
//     void accept(A a, B b, C c);
// 
// }


// Path: src/main/java/com/github/davidmoten/rx2/internal/flowable/FlowableStateMachine.java
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.rx2.StateMachine.Emitter;
import com.github.davidmoten.rx2.functions.Consumer3;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Flowable;
import io.reactivex.FlowableSubscriber;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.BiConsumer;
import io.reactivex.functions.Function3;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.fuseable.SimplePlainQueue;
import io.reactivex.internal.queue.SpscLinkedArrayQueue;
import io.reactivex.internal.subscriptions.SubscriptionHelper;
import io.reactivex.internal.util.BackpressureHelper;
import io.reactivex.plugins.RxJavaPlugins;

package com.github.davidmoten.rx2.internal.flowable;





public final class FlowableStateMachine<State, In, Out> extends Flowable<Out> {

    private final Flowable<In> source;
    private final Callable<? extends State> initialState;
    private final Function3<? super State, ? super In, ? super Emitter<Out>, ? extends State> transition;