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

Backend - executions - Methods having both @Async and @Schedulled annotations #589

Open
tomas-knap opened this issue Jul 26, 2016 · 0 comments
Assignees

Comments

@tomas-knap
Copy link

In backend, tasks are schedulled via Spring - so there is @scheduled method in Engine examining new executions every 2s and also @scheduled method in Scheduler, which check periodically (every 30s) whether new execution should be started (based on schedulled executions).

See also: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/scheduling.html

But @scheduled methods have also @async annotations. Is that needed as such methods are anyway executed in a separate thread?

Also backend-context.xml contains definition for executor (used for @async methods) and scheduler (used for @scheduled methods) (see below). Are both these thread pools needed? Take into account that Engine, executing new tasks, is anyway using Executors.newCachedThreadPool(); to create new pool of threads for running the executions.

<!-- we use annotations to run tasks -->
<task:annotation-driven executor="taskExecutor" scheduler="taskScheduler"/>
<!-- Used for asynch calls even for scheduled functions. -->
<task:executor id="taskExecutor" pool-size="8"/>
<!-- Used for Scheduled tasks.-->
<bean id="taskScheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler">
    <property name="poolSize" value="8" />
    <property name="waitForTasksToCompleteOnShutdown" value="false" />
    <property name="daemon" value="true" />
</bean>
@tomas-knap tomas-knap added this to the Release v2.3.2 milestone Jul 26, 2016
@tomas-knap tomas-knap self-assigned this Jul 26, 2016
@tomas-knap tomas-knap changed the title Methods having both @Async and @Schedulled annotations Backend - executions - Methods having both @Async and @Schedulled annotations Jul 26, 2016
@tomas-knap tomas-knap modified the milestones: Release v2.3.3, Release v2.3.2 Oct 13, 2016
@tomas-knap tomas-knap removed this from the Release v2.3.3 milestone Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant