Skip to content

A simple scheduler for jobs that can be easily used in spring boot ( >v3 ! ).

License

Notifications You must be signed in to change notification settings

CPBach/job-scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Job-scheduler

Job-scheduler is a simple library for easily scheduling background jobs without having to deal with progress tracking, Futures, Thread pools, etc. yourself. Currently this library does not support distributed job scheduling. It can be easily integrated into your Spring Boot project.

To read more about how it was created feel free to read the blog post.

Adding job-scheduler to your build and using it

The group ID is com.bubble.arts, and its artifact ID is job-scheduler. To add a dependency on the job-scheduler using Maven, use the following:

<dependency>
  <groupId>com.bubble.arts</groupId>
  <artifactId>job-scheduler</artifactId>
  <version>1.0.5-SNAPSHOT</version>
</dependency>

To add a dependency using Gradle:

dependencies {
  implementation("com.bubble.arts:job-scheduler:1.0.5-SNAPSHOT")
}

To use it in a REST controller e.g. in Spring boot :

    @Autowired
    private lateinit var jobScheduler: JobScheduler

    @PostMapping("/job/{jobName}")
    fun startJob(@PathVariable("jobName") jobName: String): String {
        return jobScheduler.scheduleJob(jobName, "Some job description") {progressTracker ->
            // Do work here and inform progressTracker on current status.
        }
    }

Links

About

A simple scheduler for jobs that can be easily used in spring boot ( >v3 ! ).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published