Fork me on GitHub
Luis C. Arbildo01:03:34

Hello, currently I'm building an application that manage various schedules for day. My first approach was have a list of task, iterate through this, and then create a schedule for each task, but today I was thinking if this is the best approach and I thought, I could have a list of task, but just create the next schedule when the previous one ends, and thus, I could have just one schedule waiting. What is your opinion about that? Is really best, or there is really not profit? (If you have a link about how you can manage schedule task, I will gratefully)


there is a scheduling library for clojure,, but I’m not sure if it’s the same use case you have in mind. can you define what you mean by “task” and “schedule?”


is a task just a function you want to run?

Luis C. Arbildo01:03:29

Yes, in a specific time

Luis C. Arbildo01:03:10

This function send a event to a client socket


it kind of depends on how robust you need it to be. scheduling is actually pretty tricky to get right, especially if tasks can fail.


it sounds like you have at least one recurring task. how many periodic tasks do you expect? can scheduled tasks be cancelled?


do tasks have to run at a specific time (eg. 5pm on a sunday) or after a certain amount of time has passed (eg. 3 hours from now)?

Luis C. Arbildo01:03:02

The minimum could be 1h, and not be canceled

Luis C. Arbildo01:03:46

The taks could change each 24hrs


for both quartzite and the http-kit timer, the scheduled tasks are only stored in memory. is it a big deal if tasks are lost if the server gets restarted or goes down for some reason?

Luis C. Arbildo01:03:38

I think have the list in the db, if the server goes down, should be a function to filter just the task with a time positive ( taskTime - now) positive

👍 4

I think both approaches could work. the main drawback of scheduling the next task after a previous one finishes is that you definitely want to make sure that if the task fails for any reason, it doesn’t prevent the next task from being scheduled


additionally, scheduling the next task after the previous one task finishes assumes tasks don’t overlap.

Luis C. Arbildo01:03:04

In terms of CPU or memory usage, there a big difference?


how many tasks are you expecting? I’m imagining that most servers could handle a quite a lot of tasks before it would start to matter


spread out over 24 hours? I’d be pretty surprised if you were running into performance issues for that amount

👍 4
Luis C. Arbildo02:03:30

@U7RJTCH6J thank you for your time!

🙂 4

Hi there, I'm having trouble accessing a Java nested class in Clojure:

flow (.. (new GoogleAuthorizationCodeFlow$Builder http-transport json-factory client-secrets scopes)
                 (setDataStoreFactory (FileDataStoreFactory. (File. tokens-directory-path)))
                 (setAccessType "offline")
Here is the relevant import:
(:import [ GoogleAuthorizationCodeFlow GoogleClientSecrets])
This is the error I'm getting:
1. Caused by java.lang.IllegalArgumentException
   Unable to resolve classname: GoogleAuthorizationCodeFlow$Builder
I haven't done much Java interop before, so I expect I'm doing something silly. This is the documentation for the GoogleAuthorizationCodeFlow class: Does anyone have any ideas or recommendations?


@soxley Pretty sure you'll need to import GoogleAuthorizationCodeFlow$Builder as well.


(off the top of my head)


(and I assume you have the library on your classpath, as part of your dependencies?)