[ 
https://issues.apache.org/jira/browse/FLINK-4384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15418570#comment-15418570
 ] 

ASF GitHub Bot commented on FLINK-4384:
---------------------------------------

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2360#discussion_r74563211
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/MainThreadExecutor.java
 ---
    @@ -52,4 +52,13 @@
         * @return Future of the callable result
         */
        <V> Future<V> callAsync(Callable<V> callable, Timeout callTimeout);
    +
    +   /**
    +    * Execute the runnable in the main thread of the underlying RPC 
endpoint, with
    +    * a delay of the given number of milliseconds.
    +    *
    +    * @param runnable Runnable to be executed
    +    * @param delay    The delay after which the runnable will be executed
    +    */
    +   void scheduleRunAsync(Runnable runnable, long delay);
    --- End diff --
    
    That is true. The `TimeUnit` variant would make it a little bit more 
explicit for the user that he has to think about the actual delay (unit-wise). 
On the other hand, milliseconds are also kind of the default time unit used 
also in other places.


> Add a "scheduleRunAsync()" feature to the RpcEndpoint
> -----------------------------------------------------
>
>                 Key: FLINK-4384
>                 URL: https://issues.apache.org/jira/browse/FLINK-4384
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination
>         Environment: FLIP-6 feature branch
>            Reporter: Stephan Ewen
>             Fix For: 1.2.0
>
>
> It is a common pattern to schedule a call to be executed in the future. 
> Examples are
>   - delays in retries
>   - heartbeats,
>   - checking for heartbeat timeouts
> I suggest to add a {{scheduleRunAsync()}} method to the {{RpcEndpoint}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to