-
Notifications
You must be signed in to change notification settings - Fork 111
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
Use default arguments for default schedulers #40
Comments
I like default arguments (and I think implicit schedulers are too complicated). |
I could take a look at this one. |
That is a very nice Scala feature. |
Sorry that I assigned this one to myself by mistake. I planed to assign to @jbripley. However, looks I can only assign to people in ReactiveX. |
…g a default Scheduler - Changes some methods to require parentheses (timestamp, timeInterval) - Make CompletenessTest fail unit tests Fixes ReactiveX#40 and ReactiveX#36
…g a default Scheduler - Changes some methods to require parentheses (timestamp, timeInterval) - Make CompletenessTest fail unit tests Fixes ReactiveX#40 and ReactiveX#36
Due to project EOL status, this improvement will not be made. |
Many methods have two versions: One without scheduler, which uses some default scheduler, and one which takes a scheduler provided by the user.
Example:
Using Scala's default arguments, these two methods could be replaced by just one:
For users, this should not cause any breaking changes.
In addition to making the API much smaller, this also provides much better documentation: Just by looking at the signature, you know what the default scheduler is, whereas now, you have to read the documenation (which might be outdated) or even resort to reading the implementation.
This solution is less powerful than what I proposed in #16, but it's much easier to understand, and does not break any existing code. Also, since the Default Schedulers Plugin now provides support for custom default schedulers, there no need to solve this using implicits.
The text was updated successfully, but these errors were encountered: