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

document @Inject ScheduledExecutorService #39796

Closed
maxandersen opened this issue Mar 30, 2024 · 4 comments · Fixed by #39880
Closed

document @Inject ScheduledExecutorService #39796

maxandersen opened this issue Mar 30, 2024 · 4 comments · Fixed by #39880
Assignees
Labels
Milestone

Comments

@maxandersen
Copy link
Contributor

Description

#39096 (reply in thread) indicates

@Inject ScheduledExecutorService is supported but when you search for that in our docs we dont mention it.

Particularly https://quarkus.io/guides/scheduler does not mention it.

100% for documenting the type safe/annotation based approach first but for some cases more dynamic scheduling is warranted and here an injected ScheduledExecutorService seems like our best option(or is there some other way?) and thus we should document/mention it IMO

Implementation ideas

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 30, 2024

/cc @manovotn (scheduler), @mkouba (scheduler)

@maxandersen
Copy link
Contributor Author

p.s. if for some reason this is mentioned somewhere already lets at least link to it from the scheduler docs.

@mkouba
Copy link
Contributor

mkouba commented Apr 2, 2024

Well, it is supported but it's not something we would like to promote.

for some cases more dynamic scheduling is warranted and here an injected ScheduledExecutorService seems like our best option(or is there some other way?) and thus we should document/mention it IMO

In fact, there is an API for programmatic scheduling: https://quarkus.io/guides/scheduler-reference#programmatic_scheduling and this API should be good enough for most use cases.

In other words, the @Inject ScheduledExecutorService is a "last resort" and should be used with caution because it's also used by various extensions.

There is a separate issue to support ManagedScheduledExecutorService (Concurrency Utilities for Java EE).

@manovotn
Copy link
Contributor

manovotn commented Apr 2, 2024

Seeing some of the recent issues, I was also thinking we might want to mention it.
We can still say it's not recommended but just stating that it exists is IMO useful.

In fact, there is an API for programmatic scheduling: https://quarkus.io/guides/scheduler-reference#programmatic_scheduling and this API should be good enough for most use cases.

We could basically just add a note about its existence underneath that section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants