def external_task_heartbeat(task, &block)
      @mutex.synchronize {
        if task == @task
          ret = block.call if block
          @last_task_heartbeat = Time.now.to_i
        end
        ret
      }
    end
def external_task_heartbeat(task, &block)
      @mutex.synchronize {
        if task == @task
          ret = block.call if block
          @last_task_heartbeat = Time.now.to_i
        end
        ret
      }
    end
callback