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

Questions, suggestions, improvements? #21

Open
zivkovic opened this issue Jul 4, 2024 · 2 comments
Open

Questions, suggestions, improvements? #21

zivkovic opened this issue Jul 4, 2024 · 2 comments

Comments

@zivkovic
Copy link

zivkovic commented Jul 4, 2024

Just tried using the library and hit a couple of problems or areas which could/should be improved.

  • Why can't I create cron trigger using the crontab syntax? (ex: "0,15,30,40,50 * * * *") Something like: https://github.com/Scogun/kcron-common
  • Why can cron trigger only be executed once per day, since I have to specify the exact time? I cannot set it as above example shows.
  • Parameter jobId could be present and optional on the shortcut methods, instead of only hardcoded.
  • Job.nextRunTime should be optional. If not set, simpy call trigger.getNextRunTime(ZonedDateTime.now(timeZone), timeZone) in the underlying code and not force the user to set it up.
  • I see you are still using java in the project. Might be nicer to have this library Kotlin only, and not dependent on java. Kotlin-datetime could maybe be used? Since I saw "Kt" in the project name, I thought you only used kotlin (like it is claimed in highlights: "Lightweight with no external dependencies other than kotlinx:kotlinx-coroutines-core from the Kotlin standard library."). Not a problem for my use case, but still if it would be kotlin only, it would be kotlin multiplatform compatible.

Documentation has some issues. Open link and click on any other trigger. It opens a "not found" page.

Hopefully I didn't criticize too much.

Thanks!

@starry-shivam
Copy link
Member

Thanks for your suggestions. Most of them look good, and I'll try to implement them when I get time later, as I'm a bit busy right now with another project.

I see you are still using java in the project. Might be nicer to have this library Kotlin only, and not dependent on java. Kotlin-datetime could maybe be used? Since I saw "Kt" in the project name, I thought you only used kotlin (like it is claimed in highlights: "Lightweight with no external dependencies other than kotlinx:kotlinx-coroutines-core from the Kotlin standard library."). Not a problem for my use case, but still if it would be kotlin only, it would be kotlin multiplatform compatible.

The thing is, the Kotlin datetime library has many missing features that you need to implement yourself, and it isn't as comprehensive as the java.time.* library. The main use case of this library is in backend applications where none of the frameworks use Kotlin/Native. Honestly speaking, Kotlin/Native isn't widely used anywhere; you always use Kotlin on the JVM platform for such tasks. Therefore, using kotlin.datetime doesn't offer many benefits here and only complicates things while adding another potential point of failure. Datetime APIs are naturally delicate, and I try to avoid any custom implementation as much as possible.

Documentation has some issues. Open link and click on any other trigger. It opens a "not found" page.

That's actually an old issue with JitPack. See jitpack/jitpack.io#3295. I can't really do much from my side about that :(

@zivkovic
Copy link
Author

zivkovic commented Jul 4, 2024

Thanks for the quick response. Sounds good.

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

No branches or pull requests

2 participants