Class WorkerOptions


  • public final class WorkerOptions
    extends Object
    Configuration for RExecutorService workers.
    Author:
    Nikita Koksharov
    • Method Detail

      • getWorkers

        public int getWorkers()
      • workers

        public WorkerOptions workers(int workers)
        Defines workers amount used to execute tasks. Default is 1.
        Parameters:
        workers - - workers amount
        Returns:
        self instance
      • getBeanFactory

        public org.springframework.beans.factory.BeanFactory getBeanFactory()
      • beanFactory

        public WorkerOptions beanFactory(org.springframework.beans.factory.BeanFactory 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
      • taskTimeout

        public WorkerOptions taskTimeout(long timeout,
                                         TimeUnit unit)
        Defines task timeout since task execution start moment
        Parameters:
        timeout - - timeout of task
        unit - - time unit
        Returns:
        self instance
      • getTaskTimeout

        public long getTaskTimeout()