Skip to content

Commit

Permalink
Merge pull request #452 from zsxwing/return
Browse files Browse the repository at this point in the history
Implemented the scheduler version of the 'Return' operator
  • Loading branch information
benjchristensen committed Oct 31, 2013
2 parents ab40f77 + dcb5d79 commit 7b997a8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rxjava-core/src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,23 @@ public static <T> Observable<T> just(T value) {
return from(list);
}

/**
* Returns an Observable that emits a single item and then completes on a specified scheduler.
* <p>
* This is a scheduler version of {@link Observable#just(Object)}.
*
* @param value
* the item to pass to the {@link Observer}'s {@link Observer#onNext onNext} method
* @param scheduler
* the scheduler to send the single element on
* @param <T>
* the type of that item
* @return an Observable that emits a single item and then completes on a specified scheduler.
*/
public static <T> Observable<T> just(T value, Scheduler scheduler) {
return just(value).observeOn(scheduler);
}

/**
* Flattens a sequence of Observables emitted by an Observable into one Observable, without any
* transformation.
Expand Down

0 comments on commit 7b997a8

Please sign in to comment.