Package org.redisson

Class RedissonExecutorService

    • Method Detail

      • generateRequestId

        protected String generateRequestId()
      • registerWorkers

        public void registerWorkers​(int workers)
        Description copied from interface: RExecutorService
        Register workers
        Specified by:
        registerWorkers in interface RExecutorService
        Parameters:
        workers - - workers amount
      • registerWorkers

        public void registerWorkers​(int workers,
                                    ExecutorService executor)
        Description copied from interface: RExecutorService
        Register workers with custom executor
        Specified by:
        registerWorkers in interface RExecutorService
        Parameters:
        workers - - workers amount
        executor - - executor instance
      • execute

        public void execute​(Runnable... tasks)
        Description copied from interface: RExecutorService
        Submits tasks batch for execution synchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
        Specified by:
        execute in interface RExecutorService
        Parameters:
        tasks - - tasks to execute
      • delete

        public boolean delete()
        Description copied from interface: RExecutorService
        Deletes executor request queue and state objects
        Specified by:
        delete in interface RExecutorService
        Returns:
        true if any of objects were deleted
      • submit

        public <T> RExecutorFuture<T> submit​(Callable<T> task)
        Description copied from interface: RExecutorService
        Submits a value-returning task for execution synchronously and returns a Future representing the pending results of the task. The Future's get method will return the task's result upon successful completion.
        Specified by:
        submit in interface ExecutorService
        Specified by:
        submit in interface RExecutorService
        Type Parameters:
        T - the type of the task's result
        Parameters:
        task - the task to submit
        Returns:
        a Future representing pending completion of the task
      • submit

        public RExecutorBatchFuture submit​(Callable<?>... tasks)
        Description copied from interface: RExecutorService
        Submits tasks batch for execution synchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
        Specified by:
        submit in interface RExecutorService
        Parameters:
        tasks - - tasks to execute
        Returns:
        Future object
      • submitAsync

        public RExecutorBatchFuture submitAsync​(Callable<?>... tasks)
        Description copied from interface: RExecutorServiceAsync
        Submits tasks batch for execution asynchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
        Specified by:
        submitAsync in interface RExecutorServiceAsync
        Parameters:
        tasks - - tasks to execute
        Returns:
        Future object
      • submit

        public <T> RExecutorFuture<T> submit​(Runnable task,
                                             T result)
        Description copied from interface: RExecutorService
        Submits a Runnable task for execution and returns a Future representing that task. The Future's get method will return the given result upon successful completion.
        Specified by:
        submit in interface ExecutorService
        Specified by:
        submit in interface RExecutorService
        Type Parameters:
        T - the type of the result
        Parameters:
        task - the task to submit
        result - the result to return
        Returns:
        a Future representing pending completion of the task
      • submit

        public RExecutorBatchFuture submit​(Runnable... tasks)
        Description copied from interface: RExecutorService
        Submits tasks batch for execution synchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
        Specified by:
        submit in interface RExecutorService
        Parameters:
        tasks - - tasks to execute
        Returns:
        Future object
      • submitAsync

        public RExecutorBatchFuture submitAsync​(Runnable... tasks)
        Description copied from interface: RExecutorServiceAsync
        Submits tasks batch for execution asynchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
        Specified by:
        submitAsync in interface RExecutorServiceAsync
        Parameters:
        tasks - - tasks to execute
        Returns:
        Future object
      • submit

        public RExecutorFuture<?> submit​(Runnable task)
        Description copied from interface: RExecutorService
        Submits a Runnable task for execution and returns a Future representing that task. The Future's get method will return null upon successful completion.
        Specified by:
        submit in interface ExecutorService
        Specified by:
        submit in interface RExecutorService
        Parameters:
        task - the task to submit
        Returns:
        a Future representing pending completion of the task
      • schedule

        public RScheduledFuture<?> schedule​(Runnable task,
                                            long delay,
                                            TimeUnit unit)
        Description copied from interface: RScheduledExecutorService
        Creates and executes a one-shot action that becomes enabled after the given delay.
        Specified by:
        schedule in interface RScheduledExecutorService
        Specified by:
        schedule in interface ScheduledExecutorService
        Parameters:
        task - the task to execute
        delay - the time from now to delay execution
        unit - the time unit of the delay parameter
        Returns:
        a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion
      • schedule

        public <V> RScheduledFuture<V> schedule​(Callable<V> task,
                                                long delay,
                                                TimeUnit unit)
        Description copied from interface: RScheduledExecutorService
        Creates and executes a ScheduledFuture that becomes enabled after the given delay.
        Specified by:
        schedule in interface RScheduledExecutorService
        Specified by:
        schedule in interface ScheduledExecutorService
        Type Parameters:
        V - the type of the callable's result
        Parameters:
        task - the function to execute
        delay - the time from now to delay execution
        unit - the time unit of the delay parameter
        Returns:
        a ScheduledFuture that can be used to extract result or cancel
      • scheduleAsync

        public <V> RScheduledFuture<V> scheduleAsync​(Callable<V> task,
                                                     long delay,
                                                     TimeUnit unit)
        Description copied from interface: RScheduledExecutorServiceAsync
        Creates in async mode and executes a ScheduledFuture that becomes enabled after the given delay.
        Specified by:
        scheduleAsync in interface RScheduledExecutorServiceAsync
        Type Parameters:
        V - the type of the callable's result
        Parameters:
        task - the function to execute
        delay - the time from now to delay execution
        unit - the time unit of the delay parameter
        Returns:
        RScheduledFuture with listeners support
      • scheduleAtFixedRate

        public RScheduledFuture<?> scheduleAtFixedRate​(Runnable task,
                                                       long initialDelay,
                                                       long period,
                                                       TimeUnit unit)
        Description copied from interface: RScheduledExecutorService
        Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
        Specified by:
        scheduleAtFixedRate in interface RScheduledExecutorService
        Specified by:
        scheduleAtFixedRate in interface ScheduledExecutorService
        Parameters:
        task - the task to execute
        initialDelay - the time to delay first execution
        period - the period between successive executions
        unit - the time unit of the initialDelay and period parameters
        Returns:
        a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
      • scheduleAtFixedRateAsync

        public RScheduledFuture<?> scheduleAtFixedRateAsync​(Runnable task,
                                                            long initialDelay,
                                                            long period,
                                                            TimeUnit unit)
        Description copied from interface: RScheduledExecutorServiceAsync
        Creates in async mode and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
        Specified by:
        scheduleAtFixedRateAsync in interface RScheduledExecutorServiceAsync
        Parameters:
        task - the task to execute
        initialDelay - the time to delay first execution
        period - the period between successive executions
        unit - the time unit of the initialDelay and period parameters
        Returns:
        RScheduledFuture with listeners support
      • schedule

        public RScheduledFuture<?> schedule​(Runnable task,
                                            CronSchedule cronSchedule)
        Description copied from interface: RScheduledExecutorService
        Creates and executes a periodic action with cron schedule object. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
        Specified by:
        schedule in interface RScheduledExecutorService
        Parameters:
        task - - command the task to execute
        cronSchedule - - cron schedule object
        Returns:
        future object
      • scheduleAsync

        public RScheduledFuture<?> scheduleAsync​(Runnable task,
                                                 CronSchedule cronSchedule)
        Description copied from interface: RScheduledExecutorServiceAsync
        Creates in async mode and executes a periodic action with cron schedule object. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
        Specified by:
        scheduleAsync in interface RScheduledExecutorServiceAsync
        Parameters:
        task - the task to execute
        cronSchedule - cron schedule object
        Returns:
        RScheduledFuture with listeners support
      • scheduleWithFixedDelay

        public RScheduledFuture<?> scheduleWithFixedDelay​(Runnable task,
                                                          long initialDelay,
                                                          long delay,
                                                          TimeUnit unit)
        Description copied from interface: RScheduledExecutorService
        Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor.
        Specified by:
        scheduleWithFixedDelay in interface RScheduledExecutorService
        Specified by:
        scheduleWithFixedDelay in interface ScheduledExecutorService
        Parameters:
        task - the task to execute
        initialDelay - the time to delay first execution
        delay - the delay between the termination of one execution and the commencement of the next
        unit - the time unit of the initialDelay and delay parameters
        Returns:
        a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
      • scheduleWithFixedDelayAsync

        public RScheduledFuture<?> scheduleWithFixedDelayAsync​(Runnable task,
                                                               long initialDelay,
                                                               long delay,
                                                               TimeUnit unit)
        Description copied from interface: RScheduledExecutorServiceAsync
        Creates in async mode and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor.
        Specified by:
        scheduleWithFixedDelayAsync in interface RScheduledExecutorServiceAsync
        Parameters:
        task - the task to execute
        initialDelay - the time to delay first execution
        delay - the delay between the termination of one execution and the commencement of the next
        unit - the time unit of the initialDelay and delay parameters
        Returns:
        RScheduledFuture with listeners support