/** * If multiple concurrently open subscriptions happen to a source * transformed by this method then an additional do-nothing subscription * will be maintained to the source and will only be closed after the * specified duration has passed from the final unsubscription of the open * subscriptions. If another subscription happens during this wait period * then the scheduled unsubscription will be cancelled. * * @param duration * duration of period to leave at least one source subscription * open * @param unit * units for duration * @param <T> * generic type of stream * @return transformer */ public static <T> Transformer<T, T> delayFinalUnsubscribe(long duration, TimeUnit unit) { return delayFinalUnsubscribe(duration, unit, Schedulers.computation()); }
/** * If multiple concurrently open subscriptions happen to a source * transformed by this method then an additional do-nothing subscription * will be maintained to the source and will only be closed after the * specified duration has passed from the final unsubscription of the open * subscriptions. If another subscription happens during this wait period * then the scheduled unsubscription will be cancelled. * * @param duration * duration of period to leave at least one source subscription * open * @param unit * units for duration * @param <T> * generic type of stream * @return transformer */ public static <T> Transformer<T, T> delayFinalUnsubscribe(long duration, TimeUnit unit) { return delayFinalUnsubscribe(duration, unit, Schedulers.computation()); }