Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Use Case]: Autostart for Scheduled Asynchronous methods #624

Open
1 of 4 tasks
njr-11 opened this issue Oct 29, 2024 · 0 comments
Open
1 of 4 tasks

[Use Case]: Autostart for Scheduled Asynchronous methods #624

njr-11 opened this issue Oct 29, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@njr-11
Copy link
Contributor

njr-11 commented Oct 29, 2024

As a ...

  • Application user/user of the configuration itself
  • API user (application developer)
  • SPI user (container or runtime developer)
  • Specification implementer

I need to be able to ...

arrange for an Asynchronous method to be automatically submitted/scheduled upon application startup

Which enables me to ...

more conveniently code applications that have business logic that should run on a schedule

Additional information

This requirement was discussed in a topic titled "Defining Jakarta EE 12 Scope in Program Plan" on the jakarta.ee-community mailing list.

One way to achieve this might be with a boolean autoStart field,

 @Asynchronous(runAt = @Schedule(daysOfWeek = DayOfWeek.TUESDAY, hours = 1),
               autoStart = true)
 public void weeklyTask() {
     ...
 }

If we wanted, we could also allow it for one-time Asynchronous methods without a Schedule.

@njr-11 njr-11 added the enhancement New feature or request label Oct 29, 2024
@njr-11 njr-11 added this to the 3.2.0 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant