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

ASF GitHub Bot commented on THRIFT-4327:
----------------------------------------

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

    https://github.com/apache/thrift/pull/1353#discussion_r138711396
  
    --- Diff: lib/cpp/src/thrift/concurrency/TimerManager.h ---
    @@ -100,13 +108,26 @@ class TimerManager {
        */
       virtual void remove(stdcxx::shared_ptr<Runnable> task);
     
    +  /**
    +   * Removes a single pending task
    +   *
    +   * @param timer The timer to remove. The timer is returned when calling 
the
    +   * add() method.
    +   * @throws NoSuchTaskException Specified task doesn't exist. It was 
either
    +   *                             processed already or this call was made 
for a
    +   *                             task that was never added to this timer
    +   *
    +   * @throws UncancellableTaskException Specified task is already being
    +   *                                    executed or has completed 
execution.
    +   */
    +  virtual void remove(Timer timer);
    --- End diff --
    
    Was removal of a task insufficient in some way?


> Improve TimerManager API to allow removing specific task
> --------------------------------------------------------
>
>                 Key: THRIFT-4327
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4327
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Francois Ferrand
>
> The TimerManager::remove() method removes all timers with the specified 
> callback, and does so by traversing the list of timers.
> This should be improved by returning a "handle" in `TimerManager::add`, and 
> supporting efficiently removing a single timer from its handle:
> {code:java}
> class TimerManager {
>      Timer add(shared_ptr<Runnable> task, const struct timeval& value);
>      void remove(Timer t);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to