Define and execute One-time task in one place. #597
corecanarias
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've been looking at different schedulers specially for One-time jobs. For this use case I would like to define the code of a task and execute it in the same place, similar to what JobRunr does.
For example, if I have a function that creates a new user and also sends an email, I would like to do something like (in kotlin):
This method will find if the task descriptor does not exists and create it and then immediately after schedule the task.
To implement this we could add the
taskResolver
to theSchedulerClient
which should be easy since it's already available in theSchedulerClient.build()
Then on the
registerAndScheduleIfNotExists
detect if the task is not defined, and define it in place:I couldn't find any reason why this wouldn't work? I think I could work on a PR if you are open to the suggestion?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions