The R Project SVN R

Rev

Rev 59039 | Rev 70260 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/base/man/taskCallbackNames.Rd
2
% Part of the R package, http://www.R-project.org
59039 ripley 3
% Copyright 1995-2007 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
17067 duncan 6
\name{taskCallbackNames}
7
\alias{getTaskCallbackNames}
50821 ripley 8
\title{Query the Names of the Current Internal Top-Level Task Callbacks}
20029 duncan 9
\description{
10
  This provides a way to get the names (or identifiers)
11
  for the currently registered task callbacks
12
  that are invoked at the conclusion of each top-level task.
27625 ripley 13
  These identifiers can be used to remove a callback.
20029 duncan 14
}
17067 duncan 15
\usage{
16
getTaskCallbackNames()
17
}
18
\value{
19
  A character vector giving the name for each of the
20
  registered callbacks which are invoked when
21
  a top-level task is completed successfully.
22
  Each name is the one used when registering
23
  the callbacks and returned as the in the
61433 ripley 24
  call to \code{\link{addTaskCallback}}.
17067 duncan 25
}
26
\note{
20029 duncan 27
  One can use \code{\link{taskCallbackManager}}
28
  to manage user-level task callbacks,
25099 hornik 29
  i.e., S-language functions, entirely within
20029 duncan 30
  the S language and access the names
31
  more directly.
17067 duncan 32
}
33
\seealso{
30912 ripley 34
  \code{\link{addTaskCallback}},
35
  \code{\link{removeTaskCallback}},
36
  \code{\link{taskCallbackManager}}\\
61433 ripley 37
  \url{http://developer.r-project.org/TaskHandlers.pdf}
17067 duncan 38
}
39
\examples{
30915 ripley 40
 n <- addTaskCallback(function(expr, value, ok, visible) {
47616 ripley 41
                        cat("In handler\n")
42
                        return(TRUE)
43
                      }, name = "simpleHandler")
17067 duncan 44
 
30915 ripley 45
 getTaskCallbackNames()
17067 duncan 46
 
30915 ripley 47
   # now remove it by name
48
 removeTaskCallback("simpleHandler")
17067 duncan 49
 
50
 
30915 ripley 51
 h <- taskCallbackManager()
52
 h$add(function(expr, value, ok, visible) {
47616 ripley 53
                        cat("In handler\n")
54
                        return(TRUE)
55
                      }, name = "simpleHandler")
30915 ripley 56
 getTaskCallbackNames()
57
 removeTaskCallback("R-taskCallbackManager")
17067 duncan 58
}
59
\keyword{environment}