// Path: src/main/java/com/plexobject/rx/Cancelable.java
// public interface Cancelable {
//     /**
//      * Cancel this operation
//      */
//     void cancel();
// 
//     /**
//      * Is operation canceled
//      * 
//      * @return
//      */
//     boolean isCanceled();
// }
// 
// Path: src/main/java/com/plexobject/rx/OnCompletion.java
// @FunctionalInterface
// public interface OnCompletion {
//     /**
//      * This method is called to notify user that all data is processed and there
//      * is no more data.
//      */
//     void onCompleted();
// }


import java.util.function.Consumer;
import com.plexobject.rx.Cancelable;
import com.plexobject.rx.OnCompletion;
package com.plexobject.rx.impl;



/**
 * This class keeps track of user subscription including callback functions.
 * This also allows user to unsubcribe from receiving data.
 * 
 * @author Shahzad Bhatti
 *
 * @param <T>
 *            type of subscription data
 */
public class SubscriptionImpl<T> implements SubscriptionObserver<T> {
    private final Consumer<T> onNext;
    private final Consumer<Throwable> onError;
// Path: src/main/java/com/plexobject/rx/Cancelable.java
// public interface Cancelable {
//     /**
//      * Cancel this operation
//      */
//     void cancel();
// 
//     /**
//      * Is operation canceled
//      * 
//      * @return
//      */
//     boolean isCanceled();
// }
// 
// Path: src/main/java/com/plexobject/rx/OnCompletion.java
// @FunctionalInterface
// public interface OnCompletion {
//     /**
//      * This method is called to notify user that all data is processed and there
//      * is no more data.
//      */
//     void onCompleted();
// }


// Path: src/main/java/com/plexobject/rx/impl/SubscriptionImpl.java
import java.util.function.Consumer;
import com.plexobject.rx.Cancelable;
import com.plexobject.rx.OnCompletion;

package com.plexobject.rx.impl;



/**
 * This class keeps track of user subscription including callback functions.
 * This also allows user to unsubcribe from receiving data.
 * 
 * @author Shahzad Bhatti
 *
 * @param <T>
 *            type of subscription data
 */
public class SubscriptionImpl<T> implements SubscriptionObserver<T> {
    private final Consumer<T> onNext;
    private final Consumer<Throwable> onError;
    private final OnCompletion onCompletion;