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

Add retry(upTo:interval:on:) #496

Merged
merged 6 commits into from
Aug 7, 2017

Conversation

tjnet
Copy link
Contributor

@tjnet tjnet commented Jul 24, 2017

Checklist

  • Updated CHANGELOG.md.

Summary

I implemented #224 and write test code

I'm new to this. Is this correct?
Please review in your free time.

var values: [Int] = []
var completed = false

original.retry(upTo: Int.max, interval: 1, on: scheduler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test that tests hitting the uptown limit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review so much! I 'll add test!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


context("with interval") {

it("should send values at the given interval until hitting the limitation") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a very accurate description of the test. It's testing the retrying, not testing the limitation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I updated description of the test. 😄

var completed = false

original.retry(upTo: Int.max, interval: 1, on: scheduler)
.start { event in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation is off. The ReactiveSwift style is to have methods like this be indented one stop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed indentation 😄


retries -= 1
return producer
}.retry(upTo: count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation doesn't match the ReactiveSwift style. It should be indented like so:

return flatMapError { error in
		
	}
	.retry(upTo: count)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review ! I 'll fix . 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed indentation.

@mdiep
Copy link
Contributor

mdiep commented Jul 25, 2017

Thanks for opening a PR!

@tjnet
Copy link
Contributor Author

tjnet commented Jul 29, 2017

I updated pull request. Any thoughts?
Please review in your free time.

retries -= 1
return producer
}
.retry(upTo: count)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#496 (comment)

This is not fully addressed yet.

return flatMapError { error in
		
	}
	.retry(upTo: count)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry.. I 'll fix soon!

retries -= 1
return producer
}
.retry(upTo: count)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indent the two lines above as well.

Copy link
Contributor Author

@tjnet tjnet Jul 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review and feedback. I sent pull request again. Is this correct?
7a5b7b9

Copy link
Contributor

@mdiep mdiep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this to the CHANGELOG as well!


scheduler.advance(by: .seconds(1))
expect(count) == 3
expect(values) == [1, 2, 3]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we verify that the error was sent as well?

Copy link
Contributor Author

@tjnet tjnet Aug 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it.
I 'll try to add testing of error and update CHANGELOG.
thanks! 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we verify that the error was sent as well?

I added test. How about this commit 73d2d4d ?

@mdiep
Copy link
Contributor

mdiep commented Aug 7, 2017

Thanks for the PR! Sorry I've been slow reviewing. It's been a busy few weeks.

The Swift 4 linux build failed, but I think that's because it needs to be updated.

@mdiep mdiep merged commit 4c0e12b into ReactiveCocoa:master Aug 7, 2017
@tjnet tjnet deleted the deferred_retry_from_rex branch August 15, 2017 06:42
@tjnet
Copy link
Contributor Author

tjnet commented Aug 15, 2017

Sorry for my late reply.. I deeply appreciate your review and feedback! 😄

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.

None yet

4 participants