Class ActorSystemScheduledExecutorAdapter

    • Constructor Detail

      • ActorSystemScheduledExecutorAdapter

        public ActorSystemScheduledExecutorAdapter​(org.apache.pekko.actor.ActorSystem actorSystem,
                                                   ClassLoader flinkClassLoader)
    • Method Detail

      • schedule

        @Nonnull
        public ScheduledFuture<?> schedule​(@Nonnull
                                           Runnable command,
                                           long delay,
                                           @Nonnull
                                           TimeUnit unit)
        Description copied from interface: ScheduledExecutor
        Executes the given command after the given delay.
        Specified by:
        schedule in interface ScheduledExecutor
        Parameters:
        command - the task to execute in the future
        delay - the time from now to delay the execution
        unit - the time unit of the delay parameter
        Returns:
        a ScheduledFuture representing the completion of the scheduled task
      • schedule

        @Nonnull
        public <V> ScheduledFuture<V> schedule​(@Nonnull
                                               Callable<V> callable,
                                               long delay,
                                               @Nonnull
                                               TimeUnit unit)
        Description copied from interface: ScheduledExecutor
        Executes the given callable after the given delay. The result of the callable is returned as a ScheduledFuture.
        Specified by:
        schedule in interface ScheduledExecutor
        Type Parameters:
        V - result type of the callable
        Parameters:
        callable - the callable to execute
        delay - the time from now to delay the execution
        unit - the time unit of the delay parameter
        Returns:
        a ScheduledFuture which holds the future value of the given callable
      • scheduleAtFixedRate

        @Nonnull
        public ScheduledFuture<?> scheduleAtFixedRate​(@Nonnull
                                                      Runnable command,
                                                      long initialDelay,
                                                      long period,
                                                      @Nonnull
                                                      TimeUnit unit)
        Description copied from interface: ScheduledExecutor
        Executes the given command periodically. The first execution is started after the initialDelay, the second execution is started after initialDelay + period, the third after initialDelay + 2*period and so on. The task is executed until either an execution fails, or the returned ScheduledFuture is cancelled.
        Specified by:
        scheduleAtFixedRate in interface ScheduledExecutor
        Parameters:
        command - the task to be executed periodically
        initialDelay - the time from now until the first execution is triggered
        period - the time after which the next execution is triggered
        unit - the time unit of the delay and period parameter
        Returns:
        a ScheduledFuture representing the periodic task. This future never completes unless an execution of the given task fails or if the future is cancelled
      • scheduleWithFixedDelay

        @Nonnull
        public ScheduledFuture<?> scheduleWithFixedDelay​(@Nonnull
                                                         Runnable command,
                                                         long initialDelay,
                                                         long delay,
                                                         @Nonnull
                                                         TimeUnit unit)
        Description copied from interface: ScheduledExecutor
        Executed the given command repeatedly with the given delay between the end of an execution and the start of the next execution. The task is executed repeatedly until either an exception occurs or if the returned ScheduledFuture is cancelled.
        Specified by:
        scheduleWithFixedDelay in interface ScheduledExecutor
        Parameters:
        command - the task to execute repeatedly
        initialDelay - the time from now until the first execution is triggered
        delay - the time between the end of the current and the start of the next execution
        unit - the time unit of the initial delay and the delay parameter
        Returns:
        a ScheduledFuture representing the repeatedly executed task. This future never completes unless the execution of the given task fails or if the future is cancelled