
org.jobrunr.jobs.lambdas.JobLambda Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jobrunr Show documentation
Show all versions of jobrunr Show documentation
An easy way to perform background processing on the JVM. Backed by persistent storage. Open and free for commercial use.
package org.jobrunr.jobs.lambdas;
/**
* This is a functional interface which represents a lambda that will be parsed by JobRunr.
* You may not create an actual instance of this class, instead you use it as follows:
*
* {@code
*
* @Inject
* MyService myService;
*
* BackgroundJob.enqueue(myService -> myService.doWork("some argument"))
* }
*
* or
*
{@code
*
* @Inject
* MyService myService;
*
* jobScheduler.enqueue(myService -> myService.doWork("some argument"))
* }
*
* This functional interface allows you to enqueue background jobs while having an actual instance available of your service.
* While processing, JobRunr will lookup the actual service in the IoC container or create a new instance using the default constructor.
*/
@FunctionalInterface
public interface JobLambda extends JobRunrJob {
void run() throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy