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

Removes methods that also have a Scheduler parameter version by adding a default Scheduler #42

Closed
wants to merge 1 commit into from

Conversation

jbripley
Copy link
Contributor

@jbripley jbripley commented Oct 9, 2014

  • Changes some methods to require parentheses (timestamp, timeInterval)
  • Make CompletenessTest fail unit tests

Fixes #40, #36

…g a default Scheduler

- Changes some methods to require parentheses (timestamp, timeInterval)

- Make CompletenessTest fail unit tests

Fixes ReactiveX#40 and ReactiveX#36
@jbripley
Copy link
Contributor Author

jbripley commented Oct 9, 2014

I removed as many methods as the Scala compiler allowed me. Got this kind of error for a couple of methods (replay, repeat, tumbling, tumblingBuffer, sliding, takeRight, timeout, timer) and couldn't add a default Scheduler.

Error:(106, 7) in trait Observable, multiple overloaded alternatives of method tumblingBuffer define default arguments.
trait Observable[+T]

For take(Duration) I'm not sure what the problem is, but RxScalaDemo wouldn't compile without it.

@samuelgruetter
Copy link
Collaborator

This is quite a major change, so we should carefully check that we get everything right. In order to review such a big change, it is necessary to have very clean commits, where each commit does one thing.
But here, you submit one commit which mixes many changes, such as:

  • delete methods without scheduler arguments
  • add default schedulers
  • add more documentation to some replay overloads
  • swap order of two other replay overloads
  • changes to some of the "Scheduler" sections of the methods' documentation
  • changes to CompletenessTest needed because of default schedulers
  • changes to CompletenessTest to make it fail the build if it isn't happy
  • changes to RxScalaDemo needed because of default schedulers

Could you please split them up? I'm not sure if the partition I made above is good, feel free to choose another one, but I'd like to see commits where each commit does one thing only.

Hint: You can use git add -i to interactively stage only parts of the changes of your working copy.

My claim that one big messy commit is not a good idea is also supported by this: You still have the following two methods:

def throttleWithTimeout(timeout: Duration)
def throttleWithTimeout(timeout: Duration, scheduler: Scheduler = ComputationScheduler())

i.e. you forgot to delete the first. A more systematic approach could eliminate such mistakes.

CompletenessTest was again made an executable file. This is of course just a detail, but the fact that you missed it makes me fear that you might have missed other, more important details as well...

Moreover, it would be nice if you posted a list of all methods, indicating for each of them whether they take schedulers, and if so, if you could add a default scheduler or not.

End of my criticism ;-) Please don't take it personally. Your contributions are appreciated a lot. I'd just like to make sure we get everything right.

@headinthebox
Copy link
Contributor

+1. Let's try to make commits as small as possible (I am looking the mirror myself!)

@jbripley
Copy link
Contributor Author

Yes, I agree that not splitting it up was a mistake.

I think I'll split it up in these pull requests:

  1. Remove non-Scheduler methods that could be removed.
  2. Add default Schedulers
  3. Update CompletenessTest and RxScalaDemo to compile
  4. Update scala docs
  5. Make CompletenessTest fail the build

Splitting up 1 and 2 will be a bit tricky since I need to know exactly which Scheduler methods supports a default scheduler, but I think I've worked that out by making this PR.

Maybe include 3 in 2 to not have failing code in-between?

@jbripley jbripley closed this Oct 10, 2014
@samuelgruetter
Copy link
Collaborator

I think I'll split it up in these pull requests

Just in case you didn't know, you can also put several commits into one pull request. That's no problem at all, because we can review each commit separately.

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.

Use default arguments for default schedulers
3 participants