taskCallbackNames            package:base            R Documentation

_Q_u_e_r_y _t_h_e _n_a_m_e_s _o_f _t_h_e _c_u_r_r_e_n_t _i_n_t_e_r_n_a_l _t_o_p-_l_e_v_e_l _t_a_s_k _c_a_l_l_b_a_c_k_s

_D_e_s_c_r_i_p_t_i_o_n:

     This provides a way to get the names (or identifiers) for the
     currently registered task callbacks that are invoked at the
     conclusion of each top-level task. These identifiers can be used
     to remove a callback.

_U_s_a_g_e:

     getTaskCallbackNames()

_V_a_l_u_e:

     A character vector giving the name for each of the registered
     callbacks which are invoked when a top-level task is completed
     successfully. Each name is the one used when registering the
     callbacks and returned as the in the call to 'addTaskCallback'.

_N_o_t_e:

     One can use 'taskCallbackManager' to manage user-level task
     callbacks, i.e., S-language functions, entirely within the S
     language and access the names more directly.

_S_e_e _A_l_s_o:

     'addTaskCallback', 'removeTaskCallback', 'taskCallbackManager'\
     <URL: http://developer.r-project.org/TaskHandlers.pdf>

_E_x_a_m_p_l_e_s:

      n <- addTaskCallback(function(expr, value, ok, visible) {
                             cat("In handler\n")
                             return(TRUE)
                           }, name = "simpleHandler")

      getTaskCallbackNames()

        # now remove it by name
      removeTaskCallback("simpleHandler")

      h <- taskCallbackManager()
      h$add(function(expr, value, ok, visible) {
                             cat("In handler\n")
                             return(TRUE)
                           }, name = "simpleHandler")
      getTaskCallbackNames()
      removeTaskCallback("R-taskCallbackManager")

