Interface RScheduledExecutorServiceAsync

    • Method Detail

      • scheduleAsync

        RScheduledFuture<?> scheduleAsync​(Runnable task,
                                          long delay,
                                          TimeUnit unit)
        Schedules a Runnable task for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
        Parameters:
        task - the task to execute
        delay - the time from now to delay execution
        unit - the time unit of the delay parameter
        Returns:
        RScheduledFuture with listeners support
      • scheduleAsync

        RScheduledFuture<?> scheduleAsync​(Runnable task,
                                          long delay,
                                          TimeUnit unit,
                                          long timeToLive,
                                          TimeUnit ttlUnit)
        Schedules a Runnable task with defined timeToLive parameter for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
        Parameters:
        task - the task to execute
        delay - the time from now to delay execution
        unit - the time unit of the delay parameter
        timeToLive - - time to live interval
        ttlUnit - - unit of time to live interval
        Returns:
        RScheduledFuture with listeners support
      • scheduleAsync

        <V> RScheduledFuture<V> scheduleAsync​(Callable<V> task,
                                              long delay,
                                              TimeUnit unit)
        Schedules a value-returning task for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
        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
      • scheduleAsync

        <V> RScheduledFuture<V> scheduleAsync​(Callable<V> task,
                                              long delay,
                                              TimeUnit unit,
                                              long timeToLive,
                                              TimeUnit ttlUnit)
        Schedules a value-returning task with defined timeToLive parameter for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
        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
        timeToLive - - time to live interval
        ttlUnit - - unit of time to live interval
        Returns:
        RScheduledFuture with listeners support
      • scheduleAtFixedRateAsync

        RScheduledFuture<?> scheduleAtFixedRateAsync​(Runnable task,
                                                     long initialDelay,
                                                     long period,
                                                     TimeUnit unit)
        Schedules a Runnable task for execution asynchronously after the given initialDelay, and subsequently with the given period. Subsequent executions are stopped if any execution of the task throws an exception. Otherwise, task could be terminated via cancellation or termination of the executor.
        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
      • scheduleWithFixedDelayAsync

        RScheduledFuture<?> scheduleWithFixedDelayAsync​(Runnable task,
                                                        long initialDelay,
                                                        long delay,
                                                        TimeUnit unit)
        Schedules a Runnable task for execution asynchronously after the given initialDelay, and subsequently with the given delay started from the task finishing moment. Subsequent executions are stopped if any execution of the task throws an exception. Otherwise, task could be terminated via cancellation or termination of the executor.
        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
      • scheduleAsync

        RScheduledFuture<?> scheduleAsync​(Runnable task,
                                          CronSchedule cronSchedule)
        Synchronously schedules a Runnable task for execution asynchronously cron schedule object. Subsequent executions are stopped if any execution of the task throws an exception. Otherwise, task could be terminated via cancellation or termination of the executor.
        Parameters:
        task - the task to execute
        cronSchedule - cron schedule object
        Returns:
        RScheduledFuture with listeners support