You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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>
The text was updated successfully, but these errors were encountered:
tomas-knap
changed the title
Methods having both @Async and @Schedulled annotations
Backend - executions - Methods having both @Async and @Schedulled annotations
Jul 26, 2016
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.
The text was updated successfully, but these errors were encountered: