Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operators: Observables from functionals (Action0, Func0, Runnable, Calla... #622

Closed
wants to merge 1 commit into from

Conversation

akarnokd
Copy link
Member

...ble)

I've created 4 operators that turn ordinary action/function calls into Observables, but unlike start and Async, the functions are called on each subscription instead of only once. They can be thought of a more generalized from(T value). Each method is named according to the accepted type to avoid overload issues with Java 8 & various dynamic languages.

The 4 additional overloads lets the user specify the scheduler where the function is called. By default, the functions are called on the threadPoolForComputation.

I don't know if there are Rx.NET equivalents of these (or they ever existed).

@cloudbees-pull-request-builder

RxJava-pull-requests #556 FAILURE
Looks like there's a problem with this pull request

@akarnokd
Copy link
Member Author

9 threads were busy with something else...

@benjchristensen
Copy link
Member

Right now I'd like to pass on adding these as it adds to the surface area of the API without strong reason. These are all wrapper methods of Observable.create which already takes a function and it is trivial to invoke an Action, Callable, Runnable etc from within the OnSubscribeFunc.

I'm not yet convinced that they are globally useful and worth increasing the already huge Observable signature, particular the from operator.

@akarnokd
Copy link
Member Author

How about introducing ObservableEx like Rx.NET had once? This way, these tools don't get lost but are not part of core.

benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request Dec 27, 2013
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX#646 (comment)
- ReactiveX#645 (comment)
- ReactiveX#622 (comment)
@benjchristensen
Copy link
Member

Merge these into #696 instead.

benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request Dec 30, 2013
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX#646 (comment)
- ReactiveX#645 (comment)
- ReactiveX#622 (comment)
benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request Dec 30, 2013
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX#646 (comment)
- ReactiveX#645 (comment)
- ReactiveX#622 (comment)
benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request Dec 30, 2013
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX#646 (comment)
- ReactiveX#645 (comment)
- ReactiveX#622 (comment)
benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request Dec 30, 2013
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX#646 (comment)
- ReactiveX#645 (comment)
- ReactiveX#622 (comment)
benjchristensen added a commit to benjchristensen/RxJava that referenced this pull request Dec 30, 2013
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX#646 (comment)
- ReactiveX#645 (comment)
- ReactiveX#622 (comment)
@akarnokd akarnokd deleted the OperationFromFunctionals branch January 13, 2014 09:59
benjchristensen added a commit to ReactiveX/RxJavaAsyncUtil that referenced this pull request Aug 29, 2014
Home for async utility functions with juc.Future, Actions, Functions etc that don’t need to be in rxjava-core.

As per discussions at:

- ReactiveX/RxJava#646 (comment)
- ReactiveX/RxJava#645 (comment)
- ReactiveX/RxJava#622 (comment)
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.

3 participants