Skip to content

Delay with subscription and item delaying observables.#734

Merged
benjchristensen merged 2 commits intoReactiveX:masterfrom
akarnokd:DelayViaObservable
Jan 14, 2014
Merged

Delay with subscription and item delaying observables.#734
benjchristensen merged 2 commits intoReactiveX:masterfrom
akarnokd:DelayViaObservable

Conversation

@akarnokd
Copy link
Member

Listed in #653

Note: onError and onCompleted events of the source are immediately propagated and will prevent emitting any pending values.

@akarnokd akarnokd mentioned this pull request Jan 10, 2014
25 tasks
@cloudbees-pull-request-builder

RxJava-pull-requests #648 SUCCESS
This pull request looks good

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the following codes do the same thing?

    public <U> Observable<T> delay(
            final Func1<? super T, ? extends Observable<U>> itemDelay) {
        return flatMap(new Func1<T, Observable<T>>() {
            @Override
            public Observable<T> call(final T t1) {
                return itemDelay.call(t1).take(1).map(new Func1<U, T>() {
                    @Override
                    public T call(U ignored) {
                        return t1;
                    }
                });
            }
        });
    }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked Rx.NET and both onNext and onCompleted of the itemDelay's Observable trigger the value emission so this and mine is incorrect.

@cloudbees-pull-request-builder

RxJava-pull-requests #660 SUCCESS
This pull request looks good

benjchristensen added a commit that referenced this pull request Jan 14, 2014
Delay with subscription and item delaying observables.
@benjchristensen benjchristensen merged commit 22fc397 into ReactiveX:master Jan 14, 2014
@akarnokd akarnokd deleted the DelayViaObservable branch May 6, 2014 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants