View Javadoc
1   package com.github.davidmoten.rx2.flowable;
2   
3   import io.reactivex.Flowable;
4   
5   public final class CloseableFlowableWithReset<T> {
6   
7       private final Flowable<T> flowable;
8       private final Runnable closeAction;
9       private final Runnable resetAction;
10  
11      public CloseableFlowableWithReset(Flowable<T> flowable, Runnable closeAction, Runnable resetAction) {
12          this.flowable = flowable;
13          this.closeAction = closeAction;
14          this.resetAction = resetAction;
15      }
16  
17      public Flowable<T> flowable() {
18          return flowable;
19      }
20  
21      public void reset() {
22          resetAction.run();
23      }
24  
25      public void close() {
26          closeAction.run();
27      }
28  
29  }