-
Notifications
You must be signed in to change notification settings - Fork 12
Scheduler
Sven Kubiak edited this page Dec 7, 2023
·
4 revisions
mangoo I/O uses plain Java methods for creating and executing periodic tasks. The integration comes in two flavours: You can either create a repeating task (e.g. every 3m) or schedule a cron task.
To create a new task, create a simple Pojo and use the @Run annotation on the method you want to be executed.
public class InfoJob {
@Run(at = "Every 3m")
public void execute() {
//Do nothing for now
}
}
The "at" parameter configures the repeating of the task. You can either use
- s = seconds ("Every 5s")
- m = minutes ("Every 15m")
- h = hours ("Every 4h")
To create a new cron task, create a simple Pojo and use the @Run annotation on the method you want to be executed.
public class InfoJobCron {
@Run(at = "0/1 * * * *")
public void execute() {
//do nothing for now
}
}
mangoo I/O 2015-2024 | [email protected]
- Getting started
- Configuration
- Routing
- Bootstrap
- Controllers
- Dependency injection
- Templating
- Working with JSON
- Persistence
- CORS
- Authentication
- Authorization
- Scheduler
- Async
- Filters
- Forms
- Session
- Flash
- Internationalization
- Caching
- Emails
- Asset management
- Logging
- Debugging
- Testing
- Administration
- Debian init.d script
- Extensions