|
118 | 118 | import rx.util.Timestamped;
|
119 | 119 | import rx.util.functions.Action0;
|
120 | 120 | import rx.util.functions.Action1;
|
| 121 | +import rx.util.functions.Async; |
121 | 122 | import rx.util.functions.Func0;
|
122 | 123 | import rx.util.functions.Func1;
|
123 | 124 | import rx.util.functions.Func2;
|
@@ -6269,4 +6270,77 @@ public <TKey, TDuration> Observable<GroupedObservable<TKey, T>> groupByUntil(Fun
|
6269 | 6270 | public <TKey, TValue, TDuration> Observable<GroupedObservable<TKey, TValue>> groupByUntil(Func1<? super T, ? extends TKey> keySelector, Func1<? super T, ? extends TValue> valueSelector, Func1<? super GroupedObservable<TKey, TValue>, ? extends Observable<TDuration>> durationSelector) {
|
6270 | 6271 | return create(new OperationGroupByUntil<T, TKey, TValue, TDuration>(this, keySelector, valueSelector, durationSelector));
|
6271 | 6272 | }
|
| 6273 | + |
| 6274 | + /** |
| 6275 | + * Invokes the action asynchronously, surfacing the result through an observable sequence. |
| 6276 | + * <p> |
| 6277 | + * Note: The action is called immediately, not during the subscription of the resulting |
| 6278 | + * sequence. Multiple subscriptions to the resulting sequence can observe the |
| 6279 | + * action's outcome. |
| 6280 | + * |
| 6281 | + * @param action |
| 6282 | + * Action to run asynchronously. |
| 6283 | + * @return An observable sequence exposing a null value upon completion of the action, |
| 6284 | + * or an exception. |
| 6285 | + * @see <a href="http://msdn.microsoft.com/en-us/library/hh229265(v=vs.103).aspx">MSDN: Observable.Start</a> |
| 6286 | + */ |
| 6287 | + public static Observable<Void> start(Action0 action) { |
| 6288 | + return Async.toAsync(action).call(); |
| 6289 | + } |
| 6290 | + |
| 6291 | + /** |
| 6292 | + * Invokes the action asynchronously on the specified scheduler, surfacing the |
| 6293 | + * result through an observable sequence. |
| 6294 | + * <p> |
| 6295 | + * Note: The action is called immediately, not during the subscription of the resulting |
| 6296 | + * sequence. Multiple subscriptions to the resulting sequence can observe the |
| 6297 | + * action's outcome. |
| 6298 | + * |
| 6299 | + * @param action |
| 6300 | + * Action to run asynchronously. |
| 6301 | + * @param scheduler |
| 6302 | + * Scheduler to run the function on. |
| 6303 | + * @return An observable sequence exposing a null value upon completion of the action, |
| 6304 | + * or an exception. |
| 6305 | + * @see <a href="http://msdn.microsoft.com/en-us/library/hh211971(v=vs.103).aspx">MSDN: Observable.Start</a> |
| 6306 | + */ |
| 6307 | + public static Observable<Void> start(Action0 action, Scheduler scheduler) { |
| 6308 | + return Async.toAsync(action, scheduler).call(); |
| 6309 | + } |
| 6310 | + |
| 6311 | + /** |
| 6312 | + * Invokes the specified function asynchronously, surfacing the result through an observable sequence. |
| 6313 | + * <p> |
| 6314 | + * Note: The function is called immediately, not during the subscription of the resulting |
| 6315 | + * sequence. Multiple subscriptions to the resulting sequence can observe the |
| 6316 | + * function's result. |
| 6317 | + * |
| 6318 | + * @param func |
| 6319 | + * Function to run asynchronously. |
| 6320 | + * @return An observable sequence exposing the function's result value, or an exception. |
| 6321 | + * @see <a href="http://msdn.microsoft.com/en-us/library/hh229036(v=vs.103).aspx">MSDN: Observable.Start</a> |
| 6322 | + */ |
| 6323 | + public static <T> Observable<T> start(Func0<T> func) { |
| 6324 | + return Async.toAsync(func).call(); |
| 6325 | + } |
| 6326 | + |
| 6327 | + /** |
| 6328 | + * Invokes the specified function asynchronously on the specified scheduler, surfacing |
| 6329 | + * the result through an observable sequence. |
| 6330 | + * <p> |
| 6331 | + * Note: The function is called immediately, not during the subscription of the resulting |
| 6332 | + * sequence. Multiple subscriptions to the resulting sequence can observe the |
| 6333 | + * function's result. |
| 6334 | + * |
| 6335 | + * @param func |
| 6336 | + * Function to run asynchronously. |
| 6337 | + * @param scheduler |
| 6338 | + * Scheduler to run the function on. |
| 6339 | + * @return An observable sequence exposing the function's result value, or an exception. |
| 6340 | + * @see <a href="http://msdn.microsoft.com/en-us/library/hh211721(v=vs.103).aspx">MSDN: Observable.Start</a> |
| 6341 | + */ |
| 6342 | + public static <T> Observable<T> start(Func0<T> func, Scheduler scheduler) { |
| 6343 | + return Async.toAsync(func, scheduler).call(); |
| 6344 | + } |
| 6345 | + |
6272 | 6346 | }
|
0 commit comments