Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@heaven-born
Copy link
Contributor

@heaven-born heaven-born commented Sep 2, 2020

minuteOfHour, secondOfMinute and hourOfDay from #4043

@CLAassistant
Copy link

CLAassistant commented Sep 2, 2020

CLA assistant check
All committers have signed the CLA.

@jdegoes
Copy link
Member

jdegoes commented Sep 3, 2020

Yes, this is the right direction! Thanks for taking a look at these. 🙏

jdegoes
jdegoes previously approved these changes Sep 4, 2020
Copy link
Member

@jdegoes jdegoes left a comment

Choose a reason for hiding this comment

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

Looks great! You want to get this merged in or add the other ones following this same pattern?

Btw I didn't check the logic too closely, but I assume this recurs always on the the next specified minute boundary, e.g. if it's minute 15 and it's supposed to recur at minute 15, then that's what it does; but if it's minute 15 and it's supposed to recur on minute 16, then it will wait till that minute. Right?

@heaven-born
Copy link
Contributor Author

heaven-born commented Sep 4, 2020

@jdegoes

You want to get this merged in or add the other ones following this same pattern?

I prefer to merge this one. I'll make one more PR for the rest of the methods.

if it's minute 15 and it's supposed to recur at minute 15, then that's what it does; but if it's minute 15 and it's supposed to recur on minute 16, then it will wait till that minute. Right?

Right. Works like this:

Minute param Current time Recur time
14 00:15:00 0000 1:14:00
15 00:15:00 0000 immediately
15 00:15:01 0000 immediately
15 00:15:00 0001 immediately
16 00:15:00 0000 00:16:00

I've just added one more test for nanosecond case, so now it ready to merge.

@heaven-born
Copy link
Contributor Author

just one more non-functional fix. Now it's ready.

@heaven-born
Copy link
Contributor Author

heaven-born commented Sep 5, 2020

since it is not merged yet, I also added secondOfMinute and hourOfDay, because they followed the same pattern. It may require some extra effort for the rest of the methods because of some limitation in java.time and different number of days in months. So separate PR will be better.

@jdegoes
Copy link
Member

jdegoes commented Sep 8, 2020

@heaven-born Excellent work. Thank you for your contribution!

fireworks

@jdegoes jdegoes merged commit 1bcbe61 into zio:master Sep 8, 2020
heaven-born added a commit to heaven-born/zio that referenced this pull request Sep 8, 2020
* Add some Schedule constructors for cron-like functionality

* doc and assertions updates

* Add some Schedule constructors for cron-like functionality: bugfixing, better tests

* Add some Schedule constructors for cron-like functionality: test simplification

* Add some Schedule constructors for cron-like functionality: formatting/refactoring

* Add some Schedule constructors for cron-like functionality: assert text fix

* Add some Schedule constructors for cron-like functionality: removed `second` param + minor fixes.

* Add some Schedule constructors for cron-like functionality: extracted unsafe code from minuteOfHour method.

* Add some Schedule constructors for cron-like functionality: scaladoc fix

* Add some Schedule constructors for cron-like functionality: removed Minute class

* Add some Schedule constructors for cron-like functionality: refactoring

* Add some Schedule constructors for cron-like functionality: moved minuteOfHour's paramter validation logic into StepFunction

* Add some Schedule constructors for cron-like functionality: simplified test

* Add some Schedule constructors for cron-like functionality: better test

* Add some Schedule constructors for cron-like functionality: added test case with nanosec

* Add some Schedule constructors for cron-like functionality: minor non-functional fix + test

* Add some Schedule constructors for cron-like functionality: added secondOfMinute and hourOfDay
heaven-born added a commit to heaven-born/zio that referenced this pull request Sep 8, 2020
@heaven-born heaven-born deleted the cron-scheduler branch September 8, 2020 15:36
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