Package org.redisson.api
Class WorkerOptions
java.lang.Object
org.redisson.api.WorkerOptions
Configuration for RExecutorService workers.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddListener
(TaskListener listener) Adds task listenerbeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) Defines Spring BeanFactory instance to execute tasks with Spring's '@Autowired', '@Value' or JSR-330's '@Inject' annotation.static WorkerOptions
defaults()
executorService
(ExecutorService executorService) Defines custom ExecutorService to execute tasks.org.springframework.beans.factory.BeanFactory
long
int
taskTimeout
(long timeout, TimeUnit unit) Defines task timeout since task execution start momentworkers
(int workers) Defines workers amount used to execute tasks.
-
Method Details
-
defaults
-
getWorkers
public int getWorkers() -
workers
Defines workers amount used to execute tasks. Default is1
.- Parameters:
workers
- - workers amount- Returns:
- self instance
-
getBeanFactory
public org.springframework.beans.factory.BeanFactory getBeanFactory() -
beanFactory
Defines Spring BeanFactory instance to execute tasks with Spring's '@Autowired', '@Value' or JSR-330's '@Inject' annotation.- Parameters:
beanFactory
- - Spring BeanFactory instance- Returns:
- self instance
-
getTasksInjector
-
getExecutorService
-
executorService
Defines custom ExecutorService to execute tasks.Config.setExecutor(ExecutorService)
is used by default.- Parameters:
executorService
- - custom ExecutorService- Returns:
- self instance
-
taskTimeout
Defines task timeout since task execution start moment- Parameters:
timeout
- - timeout of taskunit
- - time unit- Returns:
- self instance
-
getTaskTimeout
public long getTaskTimeout() -
addListener
Adds task listener- Parameters:
listener
- - task listener- Returns:
- self instance
- See Also:
-
getListeners
-