CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-io-quarkus--quarkus-bom

Cloud Native, Container First Java framework for building efficient Java applications with fast startup times and low memory usage

Pending
Overview
Eval results
Files

scheduling.mddocs/

Scheduling and Background Tasks

Quarkus provides cron-like scheduling capabilities with programmatic scheduler access and comprehensive lifecycle event handling for background task management.

Scheduling Annotations

@Scheduled Annotation

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Scheduled {
    String cron() default "";
    String every() default "";
    long delay() default -1;
    TimeUnit delayUnit() default TimeUnit.MILLISECONDS;
    String identity() default "";
    boolean skipExecutionIf() default false;
}

Schedules method execution based on cron expressions or intervals.

Scheduler Interface

public interface Scheduler {
    void pause();
    void resume();  
    boolean isRunning();
    List<Trigger> getScheduledJobs();
}

Programmatic scheduler control interface.

Usage Example:

@ApplicationScoped
public class TaskScheduler {
    
    @Scheduled(every = "30s")
    public void performCleanup() {
        System.out.println("Performing cleanup task");
    }
    
    @Scheduled(cron = "0 0 2 * * ?")  // Daily at 2 AM
    public void generateReports() {
        System.out.println("Generating daily reports");
    }
}

Install with Tessl CLI

npx tessl i tessl/maven-io-quarkus--quarkus-bom

docs

cdi-dependency-injection.md

configuration.md

core-runtime.md

data-persistence.md

index.md

reactive-programming.md

rest-web-services.md

scheduling.md

security.md

testing.md

tile.json